#83 it should be allowed that quote are escape the same

v1.0 (example)

This is a follow up to: "quote char is ignored when quote char=escape char - ID: 3030747"

It is now forbidden for CSVReader that the quote and escape character are the same. if the two are the same it throws:
"The separator, quote, and escape characters must be different!"

However http://tools.ietf.org/html/rfc4180 recommends that doublequotes within a doublequote enclosed field should be escaped by another doublequote.

In my case, I should process CSV files created by Excel. Excel does exactly this. It encloses fields in double quotes. It escapes doublequotes with a 2nd doublequote. So CSVReader can not properly process MS Excel CSV-Files.


  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-02-14

    Note also that the default CSVWriter has the quote and escape characters the same, being a double-quote. So, OpenCSV can write CSV files which it cannot read.

  • rborchert

    rborchert - 2012-02-14

    Actually, it works fine, just not the way you think. Its defaults are comma for separator, quote for the quote character, and backslash for the escape character. However, it understands two consecutive quote characters as an escaped quote character. So, if you just go with the defaults, it will work fine. I use it to read CSV files from Excel all the time, including with double double quotes.

  • bbabic

    bbabic - 2013-08-30

    JFTR, 2 and half years later, the same "bug" still exists.

  • Andrew Rucker Jones

    • status: open --> closed-out-of-date
    • Group: --> v1.0 (example)
  • Andrew Rucker Jones

    Cleaning up old issues. If this still needs attention, please open a new ticket.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks