2

I'm trying to read DBF files from a mailing software called BCC Mail Manager.

I'm not able to read the DBF file into a table:

import from dbf import * filename = r"MailList.DBF" db = Table(filename) 

Output:

Traceback (most recent call last): File "sandbox.py", line 6, in <module> db = Table(filename) File "/mnt/c/Users/Kevin/Desktop/bash/.local/lib/python3.6/site-packages/dbf/__init__.p y", line 5672, in __new__ possibles = guess_table_type(filename) File "/mnt/c/Users/Kevin/Desktop/bash/.local/lib/python3.6/site-packages/dbf/__init__.p y", line 8932, in guess_table_type reported = table_type(filename) File "/mnt/c/Users/Kevin/Desktop/bash/.local/lib/python3.6/site-packages/dbf/__init__.p y", line 8975, in table_type raise DbfError("Unknown dbf type: %s (%x)" % (version, version)) dbf.DbfError: Unknown dbf type: 140 (8c) 

2 Answers 2

2

Fun fact: Ethan was a coworker of mine when he was developing the python dbf package.

I still use BCC. Lists imported into Mail Manager can only be dBase 5 or 7. You can export from the File menu as an earlier version of dbf.

File > Export List

Change the drop down to dBase/FoxPro

Click dBase Options and choose one of the options that is not dBase 5 or 7.

Sign up to request clarification or add additional context in comments.

1 Comment

LOL. Hello Nick, thank you for your answer! but I know that a list can be exported to an earlier version of dbf. Is it possible to read user created lists and system dbf files without changing the dbase version in python? I'm currently extracting the data needed with a regex and does not work in all cases
1

Fun fact: Working with BCC was why I originally wrote dbf.

As I recall, you can change the BCC settings to specify which format of dbf file you want to write (at least, 10 years ago you could). Try switching to db3 or vfp6.

1 Comment

Cool fun fact! :) I tried to change the file format with no luck, it seems like the setting is not available anymore. I also forgot to mention that I am trying to read dbf from the BCC system and not dbf files I've created. I get a different error if I try to open a file that was created dbf.DbfError: Tables of type (4, 'dBase IV') not supported

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.