[R] Re: read dbf files into R

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Wed Sep 29 14:52:14 CEST 2004


On 29-Sep-04 Hisaji ONO wrote:
>> > Is there a linux-based/free command line tool for
>> converting
>> > dbf files into txt?
>> 
> 
>  How about DBF2CSV 1.0 in
> http://www.dirfile.com/dbf2csv.htm.
> 
>  This is a perl script.

This seems to work well in extracting the field-names and
data from a DBF file.

However, it seems also that it wraps every field inside
quotation marks, as in

"....","....","....",...

which will not usually be wanted (this use of quotation
marks is strictly speaking only needed in CSV for fields
where a comma is part of the field data).

However, in unix/linux at least, the resulting CSV file
can be mended by piping it through 'tr', as in

  cat oldCSVfil.csv | tr -d '"' > newCSVfile.csv

(assuming, of course, that you don't have field data
with commas inside ... )

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 29-Sep-04                                       Time: 13:52:14
------------------------------ XFMail ------------------------------




More information about the R-help mailing list