dbf

Copy a column changing the name in Dbf

和自甴很熟 提交于 2019-12-24 06:47:57
问题 i have a dbf file with this scruture: __SAMPLEID 1 2 3 4 I want to copy the values but change na column name, the result i expect is something like that: __SAMPLEID ID 1 1 2 2 3 3 4 4 i try to use dbfpy or db libs on python, its possible to do that? 回答1: Using my dbf library: To rename a field in an existing dbf: import dbf with dbf.Table('file-name-here.dbf') as table: table.rename_field('old_name', 'new_name') To copy the table, giving a new name to certain fields: import dbf old_table =

Import fixed width data file with no line separator

主宰稳场 提交于 2019-12-23 09:28:01
问题 I have fixed width data files (.dbf) that don't have line separators. Here is what two lines of that datafile looks like: 20141101 77h 3.210 0 3 20141102 76h 3.090 0 3 The widths of one line is c(8,4,7,41) for date (8), some time measure (4), the data point (7), and some other columns that i can summarize in one "rest" column (41). After one line there is no separator and the next line is just appended to the first line. All time steps are basically written consecutively in one massive line.

How to Read a DBase File in Java or Oracle PL/SQL

倖福魔咒の 提交于 2019-12-23 03:17:15
问题 I've been provided a Dbase file (.dbf) and have been asked to implement a parser to load the data into an Oracle DB. The only available tools I have on hand are Java 8 and Oracle PL/SQL. Having never written a parser or dealt with this data format before, I'm completely lost as to how to go about the whole thing. Any help or guidance would be most appreciated. Thank you, 回答1: After tearing my hair out for some time, I think I've finally found an answer. Seemed a little crass to answer my

How does one find out how a DBF file or any file is formatted?

扶醉桌前 提交于 2019-12-23 03:12:18
问题 I am attempting to pick apart a DBF file using the code in THIS AskTom post however I have no clue where I would even go to figure out how the files I'm wanting to pick apart are formatted? How was the original AskTom answer even produced? How do I figure out the dbf Header. How do I know where within the dbf file the data is stored or even how to pull out that data? My goal is to work with the code provided and come up with a solution as others have done but I'm stuck at the very first part.

How does one find out how a DBF file or any file is formatted?

寵の児 提交于 2019-12-23 03:12:06
问题 I am attempting to pick apart a DBF file using the code in THIS AskTom post however I have no clue where I would even go to figure out how the files I'm wanting to pick apart are formatted? How was the original AskTom answer even produced? How do I figure out the dbf Header. How do I know where within the dbf file the data is stored or even how to pull out that data? My goal is to work with the code provided and come up with a solution as others have done but I'm stuck at the very first part.

Detect the encoding from A DBF

♀尐吖头ヾ 提交于 2019-12-22 09:49:49
问题 I want to detect the encoding of DBF automatically, but the structure of DBF file doesn't contains any information in the header of DBF file. I used to use a DBF Viewer and it opens with a proper encoding information. So I'm not sure how they implement it. I researched the structure of DBF file and there is a language driver id, but we don't have an ID to CodePage table, any one have clue? 回答1: I did a lot of research and found this article in Esri's official website: http://webhelp.esri.com

How can I read a part of a dBase file

人盡茶涼 提交于 2019-12-22 09:48:15
问题 I have a very large dBase file (1.64Gb). It takes a very long time to load the whole file in R using the standard foreign::read.dbf() function. I would like to load only a few variables in the dataset. Does anyone have a solution ? 回答1: I think the read.dbf(...) function in package foreign was intended for reading the *.dbf part of a shapefile, in which case reading in part of the file really doesn't make sense. You seem to want to do something different. Using RODBC might work, depending on

C# Open DBF file

匆匆过客 提交于 2019-12-22 04:46:21
问题 I'm having a problem opening a DBF file - I need to open it, read everything and process it. I tried several solutions (ODBC/OLEDB), several connection string, but nothing worked so far. The problem is, when I execute the SQL command to get everything from the file, nothing gets returned - no rows. What's even more odd, the content of the DBF file being opened get deleted. See the code I have: public override bool OpenFile(string fileName, string subFileName = "") { OleDbConnection con = new

Python dbfpy and FoxPro

﹥>﹥吖頭↗ 提交于 2019-12-21 20:06:59
问题 Alright, I'm using an ancient database format here, dbf files. Don't ask why, just know a certain software decided to extend foxpro support because microsoft decided to extend foxpro support. Now, I'm getting the following error on a specific file. I have successfully loaded another file and I'm curious if there is something wrong with this database. I'm sure you probably need to look at the database to determine that, but its way to huge to post so I'll take what I can get. Traceback (most

How to create table in mdb from dbf query

Deadly 提交于 2019-12-20 05:10:36
问题 I have a dbf that I would like to copy into a new mdb using VB6. The following is where I am up to, I can create the new mdb easily enough, however, I thought I could just do a Select query with an INTO to create a new table with the data. Please note: what I'm assuming is the MSAccess table gets created at the time the sql query gets run. I get a syntax error in FROM clause. What I was trying to do is manipulate this sql query to do what I need it to: sql = "INSERT INTO [Table1] SELECT *