Bad CSV output

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu Jan 9 07:24:37 PST 2014


On 01/09/2014 06:58 PM, Julien Ponge wrote:
> I made an export of a spreadsheet from Numbers and I found the catch :-)
> 
> :%s/,/;/g
> 
> does the trick on JMH CSV.

God dammit.

> May I suggest to change to ';' unless the RFC has something smart in favour of ','?

RFC 4180 actually quite stringent for separator to be 0x2C, which is an
ASCII comma. Given that, I think JMH will stick with commas for CSV output.

I think there are two ways to go from here:
  a) The wikipedia article [1] says: "(although Excel uses the list
separator of the current locale settings, which is a semicolon instead
of a comma for many locales)", which suggests there is a workaround for
Excel's dumbfoundness? Get to locale and put the comma there?
  b) As the alternative, I put the SCSV (Semi-Colon Separated Values)
formatter [2] in JMH. Please try to use it and see if Excel consumes it
right.

Pick your poison.

-Aleksey.

[1] http://en.wikipedia.org/wiki/CSV_application_support
[2] http://hg.openjdk.java.net/code-tools/jmh/rev/ae2f1275697d


More information about the jmh-dev mailing list