Discussion:
[CSV]: Ignore newline in record value while using Apache Common CSV?
(too old to reply)
piyush gajjariya
2018-01-29 16:59:22 UTC
Permalink
Hi All,

Anyone knows how to address issue mentioned in below post?

https://stackoverflow.com/questions/48501028/ignore-newline-in-record-value-while-using-apache-common-csv

-Piyush
Gary Gregory
2018-01-29 21:02:16 UTC
Permalink
I replied on SO.

Gary

On Mon, Jan 29, 2018 at 9:59 AM, piyush gajjariya <
Post by piyush gajjariya
Hi All,
Anyone knows how to address issue mentioned in below post?
https://stackoverflow.com/questions/48501028/ignore-
newline-in-record-value-while-using-apache-common-csv
-Piyush
Gary Gregory
2018-01-29 21:02:41 UTC
Permalink
You can also submit a unit test patch if you think you can demonstrate a
bug.

Gary
Post by Gary Gregory
I replied on SO.
Gary
On Mon, Jan 29, 2018 at 9:59 AM, piyush gajjariya <
Post by piyush gajjariya
Hi All,
Anyone knows how to address issue mentioned in below post?
https://stackoverflow.com/questions/48501028/ignore-newline-
in-record-value-while-using-apache-common-csv
-Piyush
piyush gajjariya
2018-01-30 02:41:39 UTC
Permalink
Hi Gary,

Thanks for reply. i replied below to your reply in thread
https://stackoverflow.com/questions/48501028/ignore-newline-in-record-value-while-using-apache-common-csv.
can you please suggest any work-around?

If i don't give withQuote(null) as below then i am getting this run time
exception " (line 12494) invalid char between encapsulated token and
delimiter". which looks this issue
https://stackoverflow.com/questions/26729799/invalid-char-between-encapsulated-token-and-delimiter-in-apache-commons-csv-libr
so i added withQuote(null) to fix that.

CSVParser parser = CSVParser.parse(reader,
CSVFormat.RFC4180.withFirstRecordAsHeader());

Exception:

Exception in thread "main" java.lang.IllegalStateException: IOException
reading next record: java.io.IOException: (line 12494) invalid char between
encapsulated token and delimiter
at org.apache.commons.csv.CSVParser$1.getNextRecord(CSVParser.java:530)
at org.apache.commons.csv.CSVParser$1.hasNext(CSVParser.java:540)

Any other work-around of this?
Post by Gary Gregory
I replied on SO.
Gary
On Mon, Jan 29, 2018 at 9:59 AM, piyush gajjariya <
Post by piyush gajjariya
Hi All,
Anyone knows how to address issue mentioned in below post?
https://stackoverflow.com/questions/48501028/ignore-
newline-in-record-value-while-using-apache-common-csv
-Piyush
Loading...