csv format to DBase III format

William coriolis_wong at yahoo.com.hk
Tue Jan 10 10:40:38 CET 2006


Peter Otten wrote:
> William wrote:
>
> > Peter Otten wrote:
> >> coriolis_wong at yahoo.com.hk wrote:
> >>
> >> > 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.
>
> No idea, but here's some brainstorming.
>
> >     f = open('test.dbf','w')
>
> First make sure that you open the file in binary mode 'wb'.
> If you have an application around that can generate dbfs you could compare a
> manually created file with the python-generated one. Have you tried the dbf
> with no records? If that is opened without error, you could successively
> add records until you find the culprit. Finally, if Excel and Access
> disagree about the dbf's validity, the Access import filter could be
> broken. Are there other filters for the Dbase family (Foxpro, Clipper)? Try
> one of them.
>
> Peter

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."

Anybody have any idea?

William




More information about the Python-list mailing list