from dbf import *
test = Table("testfile.dbf")
for record in test:
print record
x = raw_input("") # to pause between showing records
这是我现在所知道的,但希望这是一个有用的开始,为其他人谁发现这个问题!
April 21, 2012 SJK Edit: Per Ethan Furman's comment, I should point out that I actually don't know which of the data files were necessary, besides the DBF file. The first time I ran the script, with only the DBF available, it complained of a missing support file. So, I just copied over the BAK, CDX, FPT (not FBT as I said before edit), TBK files and then it worked.
你可以试试这个recipe on Active State。
还有一个DBFReader module你可以试试。
支持memo fields。
我更喜欢dbfpy。它支持读取和写入
.DBF
文件,并且可以处理格式的大多数变体。这是我发现的唯一一个既可以读写我使用过的一些旧系统的遗留DBF文件的实现。我能够使用PyPIhttp://pypi.python.org/pypi/dbf中的DBF包读取DBF文件(以及相关的BAK、CDX、FBT、TBK文件**)。我是python新手,对DBF文件一无所知,但从我女朋友的公司(使用名为AIMsi的音乐商店POS应用程序创建)读取DBF文件很容易。
在安装dbf包(我使用aptitude并安装了dbf版本0.88)之后,以下python代码工作了:
这是我现在所知道的,但希望这是一个有用的开始,为其他人谁发现这个问题!
相关问题 更多 >
编程相关推荐