You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Tridib Samanta <tr...@gmail.com> on 2009/09/03 18:19:27 UTC

[CSV] Double quote not escaped properly for EXCEL strategy

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