0

I have CSV data like this (fully quoted, comma separated, records finishes with ';':

"595010","MHD-10 SKIBUS Usti n.L., Divadlo - Telnice, Zadni Telnice","25013891","A","A","0","0","0","0","","","","","23122017","11032018","1","1";

I configured my Apache CSV parser with:

CSVFormat.newFormat(',')
    .withQuoteMode(QuoteMode.ALL)
    .withQuote('\"')!!
    .withRecordSeparator(';')

But when I am trying to parse it, I am getting error

java.lang.IllegalStateException: IOException reading next record: java.io.IOException: (line 1) invalid char between encapsulated token and delimiter

when parser processes ';'. What am I doing wrong? Thank you for answers

Viktor Sinelnikov
  • 1,631
  • 2
  • 16
  • 26
  • 1
    https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#withRecordSeparator-java.lang.String- if you see this it say it only support /n /r as record separators. – Rohit Dec 23 '17 at 18:43
  • 1
    Yes, commons-csv cannot parse this additional end-of-line-character right now. – centic Dec 25 '17 at 07:21

0 Answers0