views:

447

answers:

4

Dear all,

I need to convert a very large file from DBF format to CSV format. I have tried Microsoft Excel to do the job, but the problem is that I cannot see more than 65500 registers when I open and export the file.

Microsoft Access couldn't open the file, too.

I have found on google some shareware tools, searching for "DBF to CSV". Have you tried any of these with very large files?

Also, any solution that could export to mysql or postgresql database formats will be welcome.

Thanks in advance for your responses, best regards,

A: 

Use OpenOffice - Its free and can handle a lot of rows. With that many rows, you might need to split the file and then convert the pieces and then reassemble.

Shane C. Mason
We have tried with openoffice 2.4 too. We have had the same results, as it does not display more than 65000 rows. Do you know if it will be better with OpenOffice 3.0?
Ansar
@Shane C. Mason: If the OP has no tools to read a DBF file and write a CSV file, how do you expect him make a DBF file containing the second bunch of 64K (K==1024) rows? A hex editor?
John Machin
@ John - split or dd are pretty convenient for that.
Shane C. Mason
@Shane: Convenient? Chop the header off and save it, chop the remainder (data area) up into pieces, splice a copy of the header on to the front of each piece, edit the header of each piece to ensure that it's a well-formed DBF file ... yes, looks very easy. Perhaps you'd like to publish instructions on how to calculate where to split and how to edit the headers.
John Machin
@John - Google the file specs - not that difficult - http://www.dbf2002.com/dbf-file-format.html - this is a PROGRAMMING forum - if the OP didnt want programming related answers then perhaps they should try an Office forum...
Shane C. Mason
@Shane: that is not a spec, it is a subset of the knowledge required. In any case most people with the ability to grok the file format and write such a splitter would instantly realise that they might as well just write out the required single csv file anyway. DBF in an "Office" forum??
John Machin
A: 

OpenOffice 3.0 Calc maxes out at 65K rows. I tried importing a large DBF into OpenOffice 3.0 Base but it handed the job off to Calc :-(

Alternative: if you have Python 2.4 to 2.6, I can send you a copy of my soon-to-go-public DBF-reading module plus a DBF-to-CSV script. To get my e-mail address, search for "John Machin xlrd" [xlrd is my Excel XLS-reading package].

John Machin
This is a very good thing. Please edit your post when you publish it, and I will mark you as accepted answer (and vote you up). Thanks a lot.
Ansar
+1  A: 

go to http://www.the-oasis.net/ftpmaster.php3?content=ftputils.htm

look for this file dbx130.zip

Bytes: 125,478 Date: 1993-03-22

dbMAX is an xBASE utility that will allow complete multi-user access
to any xBASE databases and indexes. The program uses a CUA-type menu
system with Brief(R)-style hot keys and can browse databases in up to
250 moveable, sizable windows. Almost every Clipper(R)/dBASE(R)
command is available, allowing dbMAX to replace the dBASE
Assist/Control Center or Computer Associates' DBU utility. dbMAX also
has a partially open architecture, allowing programmers to create
their own menus and operate on dbMAX internal data structures.

this utility has a dos ui but it allows you via the Copy function on the menu to export entire dbf tables in SDF or CSV format. I personally know that it can handle a file with 3.8 million rows so it should be able to handle your table.

kloucks
The utility does not work on Windows XP. The clipper library is missing. How can I install it?
Ansar
kloucks
+2  A: 

http://www.codeplex.com/fastdbf

"Also included here is a small utility that reads DBF files and outputs CSV files! "

Jacob