1

I am parsing a CSV file with opencsv and all the fields are separated by commas and are enclosed in double quotation marks. If a field contains double quotes, open CSV doesn't parse the file properly. An example below:

"aaa","b""bb","ccc"

Right now the constructor I am using is:

reader = new CSVReader(new FileReader(csvFile), ',', '"', 1);
Bogdan Kobylynskyi
  • 1,150
  • 1
  • 12
  • 34
  • Possible duplicate of [Parse CSV with double quote in some cases](http://stackoverflow.com/questions/7800494/parse-csv-with-double-quote-in-some-cases) – Bogdan Kobylynskyi May 12 '17 at 18:25
  • Use the `CSVReader(FileReader, ',')` constructor then parse the `String[]` yourself. One of them will be `"b""bb"` then handle it however you want. You'll just have to deal with the quotes now through `Regexp` or whatever. – jiveturkey May 12 '17 at 18:30
  • Which opencsv version are you using ? I have tested it, it parse perfectly and here is the output `[aaa, b"bb, ccc]` – Ashraful Islam May 12 '17 at 18:38
  • Version 3.8. IS your constructor the exact same? – Harshil Chokshi May 12 '17 at 19:17

0 Answers0