Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#2136 closed enhancement (fixed)

CSV driver specific dataset creation option "SEPARATOR=SEMICOLON"

Reported by: sfkeller Owned by: Even Rouault
Priority: normal Milestone: 1.7.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: csv seperator
Cc: warmerdam

Description

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

Change History (7)

comment:1 by sfkeller, 16 years ago

Component: defaultOGR_SF

comment:2 by Monty, 16 years ago

Keywords: csv seperator added

I also need the Semicolon Seperator, for Fileimports to Openoffice and other spreadsheet application. Replace , for ; dont work realy.

comment:3 by Even Rouault, 15 years ago

Milestone: 1.7.0
Resolution: fixed
Status: newclosed

In r16759, add support for reading and writing CSV files with semicolon or tabulation as the field separator. Test added in r16760

comment:4 by warmerdam, 15 years ago

Resolution: fixed
Status: closedreopened

Even,

I'm quite nervous that you have changed the core csv code autodetect separators. This seems risky. Given that you are doing so, I would prefer that it default to the original behavior (using the comma). I would also suggest that CSVDetectSeperator should understand csv style quoting so it doesn't pick up delimiters that are within a quoted string in the file.

comment:5 by warmerdam, 15 years ago

Cc: warmerdam added
Owner: changed from warmerdam to Even Rouault
Status: reopenednew

comment:6 by Even Rouault, 15 years ago

Resolution: fixed
Status: newclosed

r16752: "Partial revert of r16759 so we don't use separator autodetection for core CSV code, but only for new API CSVReadParseLine2(); Improve CSVDetectSeperator() to understand CSV quoting"

comment:7 by Even Rouault, 15 years ago

grr, the right revision is r16762

Note: See TracTickets for help on using tickets.