csv format to DBase III format

Thomas Ganss tganss_at_t_dash_online_dot_de-remove-all-after-first-real-dash at yahoo.com
Sun Jan 15 07:38:54 EST 2006


>>>>>I need to transfer csv format file to DBase III format file.
>>>>>How do i do it in Python language?
>>>I create a dbf file, it can be opened by Excel but it cannot be opened
>>>by Access. Where is the error in my script.
> I have no idea too. I use Foxpro to open the file, but it is failure.
> The warning message is as follows
> "Either the table record count does not match the actual records in the
> table, or the file size on the disk does not match the expected file
> size from the table header."

The error message is quite clear -
in the .dbf format the record count is written to the file header.

The filesize should be record_count*recordsize + headersize.

There are some options to fix a dbf, even via foxpro.
Comparing file size / header info should point you to your error.

Such a task (if targeted to run on a win machine) is probably
better done in foxpro or another dbase clone / file handler:
would take probably less a handful of lines and be much safer.

my 0.02 EUR


More information about the Python-list mailing list