commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tridib Samanta" <tridib.sama...@gmail.com>
Subject [CSV] Double quote not escaped properly for EXCEL strategy
Date Thu, 03 Sep 2009 16:19:27 GMT
Hi Friends,

I am using Commons CSV to generate a CSV file. But, if the value contains
double quote, it's been escaped by \ (back slash). But for Excel, it should
be escaped by another double quote.
Here is my code:

        CSVPrinter printer = new CSVPrinter(writer);
        printer.setStrategy(CSVStrategy.EXCEL_STRATEGY);
        printer.println(new String[]{"c", "234", "\""});

Output generated is:
        c,234,"\""

But for Excel I expect:
        c,234,""""

Can anybody fix this in the CSV code base please? I want it to be part of
the standard library instead of making changes locally.

Thank you.
-Tridib


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message