Hi, >>>>>I need to transfer csv format file to DBase III format file. >>>>>How do i do it in Python language? >>>> >>>>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715 >> >>>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 thomas -- http://mail.python.org/mailman/listinfo/python-list