dbf

Pandas: transform a dbf Table into a dataframe

早过忘川 提交于 2019-12-09 08:09:10
问题 I want to read a dbf file of an ArcGIS shapefile and dump it into a pandas dataframe. I am currently using the dbf package. I have apparently been able to load the dbf file as a Table, but have not been able to figure out how to parse it and turn it into a pandas dataframe. What is the way to do it? This is where I am stuck at: import dbf thisTable = dbf.Table('C:\\Users\\myfolder\\project\\myfile.dbf') thisTable.open(mode='read-only') Python returns this statement as output, which I frankly

Search in DBF and update record

夙愿已清 提交于 2019-12-09 01:52:39
问题 Code: #!/usr/bin/python db = dbf.Dbf("MEST2.DBF") #LINE TO UPDATE: rec = db[0] #PROEST IS A field of my dbf. I'm assigning 1 to this field line 0 rec["PROEST"] = 1 rec.store() del rec db.close() IMAGE OF DBF TABLE: http://i.stack.imgur.com/1UHE1.jpg My problem is I can not change the records by rows, cause the position of the products (PROCOD) may vary. Any suggestions to get the PROCOD and change the value of PROEST? UPDATED: #!/usr/bin/python import dbf db = dbf.Table('MEST2.DBF') with db:

How can creating dbf file, and define encoding in Notepad, or VBA

▼魔方 西西 提交于 2019-12-08 14:21:45
问题 what is DBF4 (dBase IV)(*.dbf) file fundamental format? And how can create these file in a same word editor as Notepad with typing?( Update: , or excel VBA?) What is that's format specifications as: Delimiter (Same as: , or tab or etc) Separator (may Same as above!) (If these two are not synonymy) Row End character: (Same as vbCrLf ) Defining headers of columns(fields). Code-Page of encoding : (same as: Unicode - 1256 or etc) and others... Please present an algorithm for creating this DB file

How can I specify the character encoding to be used by OLEDB when querying a DBF?

吃可爱长大的小学妹 提交于 2019-12-08 09:19:39
问题 Is it possible to specify which character encoding should be used by OLEDB when querying a DBF file? A possible work-around would be to encode the query string before the OLEDB call to the DBF file's character encoding and then encode all the results when they are returned. This will work but it would be nice if OLEDB or possibly ADO.NET could do this for me. UPDATE The suggestion by Viktor Jevdokimov does not seem to work automatically. But it made me investigate manual conversion of the

How to delete record from dbf file using python dbf module?

我是研究僧i 提交于 2019-12-08 09:12:24
问题 I'm trying to write/delete records in a visual foxpro 6 dbf file, using python 2.7 and the dbf package: import dbf tbl = dbf.Table('test.dbf') tbl.open() rec = tbl[0] print(rec.__class__) rec.delete_record() Result: <class 'dbf.ver_2.Record'> Traceback (most recent call last): File "C:/Python/Projects/test/test.py", line 11, in <module> rec.delete_record() File "C:\Python\Projects\test\venv\lib\site-packages\dbf\ver_2.py", line 2503, in __getattr__ raise FieldMissingError(name) dbf.ver_2

Changing the Character set of a .dbf file

主宰稳场 提交于 2019-12-08 04:00:22
问题 I have this java application that should load and print data with french special characters from a .dbf or dBase3 file but it doesn't work; the characters are not showing. I asked this question thinking that the problem was related only to the printing, but if you see the comments you can understand that i figured out that the problem was related to the database and not to the printing, since when adding a special character to my JTextPane, it prints normally... and i tried changing the

Looking for an SQL scripting language to manipulate DBF files

给你一囗甜甜゛ 提交于 2019-12-08 01:06:45
问题 I have a large collection of DBF files (about 1100 of them) that I need to analyze for a client. Each file contains a single table. I need to perform a query on each table, copy the results into one large results table (which will hold the results from all files), and then move on to the next DBF file. At the end I need to save the results table in a format I can manipulate later. Does anyone know of a scripting language that can make this easy for me? There are a few caveats: 1.) I need

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

寵の児 提交于 2019-12-08 00:00:30
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, After tearing my hair out for some time, I think I've finally found an answer. Seemed a little crass to answer my question myself, so I posted it here: https://stackoverflow.com/a/56303353/1148258 Hope it helps anyone else

[Oracle] 误删除了Oracle的DBF文件之解决方案

此生再无相见时 提交于 2019-12-07 02:52:43
第一步:用sqlplus以管理员方式登录 sqlplus / as sysdba 问题描述:startup启动数据库时提示: ORA-01157:无法标识/锁定数据文件 6 -请参阅 DBWR跟踪文件 ORA-01110:数据文件 6:'G:\GDQY\PERSON.DBF' 解决方案: 查看trace文件发现以下信息 *** SERVICE NAME:() 2010-07-26 17:32:22.531 *** SESSION ID:(167.1) 2010-07-26 17:32:22.531 ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: data file 6: 'G:\GDQY\PERSON.DBF' ORA-27041: unable to open file OSD-04002: 无法打开文件 O/S-Error: (OS 3) 系统找不到指定的路径。 可能是PERSON.DBF文件丢失或者损坏,查看G盘发现没有GDQY文件夹。此时才想起来,由于磁盘之前中过病毒,删除了一些文件。发现问题根源所在,接下来便可以解决问题了,把PERSON.DBF OFFLINE DROP 掉。具体步骤如下: 1、ALTER SYSTEM SET "_allow_resetlogs

Create .DBF file from SQL table records

南楼画角 提交于 2019-12-07 01:29:03
问题 I want to create a .DBF file from SQL table records. Such as if there is a table named CountryMaster in SQL and it has 5 columns: ID int identity(1,1) Name varchar(100) Details varchar(200) Status bit CreatedDate datetime And it has 100 rows. How can I export these records with headers in .DBF file from C#? NOTE: Created .DBF file size must be very compact. 回答1: You can see the Xbase Data file (*.dbf) structure and write your own code but I have done the implementation and have been using it