Opened 12 years ago

Closed 11 years ago

Last modified 11 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 Changed 12 years ago by sfkeller

Component: defaultOGR_SF

comment:2 Changed 12 years ago by Monty

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 Changed 11 years ago by Even Rouault

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 Changed 11 years ago by warmerdam

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 Changed 11 years ago by warmerdam

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

comment:6 Changed 11 years ago by Even Rouault

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 Changed 11 years ago by Even Rouault

grr, the right revision is r16762

Note: See TracTickets for help on using tickets.