[gdal-dev] CSV writer output parameter bug (file or dir?) and enhancement requests (SEPARATOR and FIELDSENCLOSED)

Stefan Keller sfkeller at gmail.com
Mon Jan 14 05:56:02 EST 2008


1. I think I got a bug: When one indicates an output parameter for any OGR
driver it can either be a directory or a file name depending on input and
parameters.
Now in the following case output is clearly a single layer: ogr2ogr -f CSV
towns.csv towns.shp . The CSV writer always outputs a directory - in this
case: towns.csv/towns.csv - but I expected just towns.csv as a file (without
directory).

2. Enhancement request: Currently the CSV writer outputs commas (",") as
field value separators (or delimiters). This follows "best practices" of CSV
but fails to serve MS Excel as expected. In order to support also a
non-negligible amount of Windows (and Mac) users I suggest to be able to
specify also semicolon or tab as separator.
Proposal: CSV driver specific dataset creation option for field value
separators, called SEPARATOR where commas are the default. This may be
overridden through use of the dataset creation option SEPARATOR which may
have a value of COMMA, SEMICOLON, or TAB. Example: ogr2ogr -f CSV -dsco
SEPARATOR=SEMICOLON out myfile.shp
I already submitted a request for this.

3. There is another issue: There is an 'official' attemtpt to specify CSV
in RFC 4180 (http://www.ietf.org/rfc/rfc4180.txt).
There it says that "Each field may or may not be enclosed in double quotes".
So, this could be another enhancement, e.g. ogr2ogr -f CSV -dsco
FIELDSENCLOSED=YES. Default would be NO.

-- Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080114/c138605e/attachment-0001.html


More information about the gdal-dev mailing list