You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by piyush gajjariya <pi...@gmail.com> on 2018/01/29 16:59:22 UTC

[CSV]: Ignore newline in record value while using Apache Common CSV?

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

Re: [CSV]: Ignore newline in record value while using Apache Common CSV?

Posted by piyush gajjariya <pi...@gmail.com>.
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?

On Tue, Jan 30, 2018 at 2:32 AM, Gary Gregory <ga...@gmail.com>
wrote:

> I replied on SO.
>
> Gary
>
> On Mon, Jan 29, 2018 at 9:59 AM, piyush gajjariya <
> piyush.gajjariya@gmail.com> wrote:
>
> > 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
> >
>

Re: [CSV]: Ignore newline in record value while using Apache Common CSV?

Posted by Gary Gregory <ga...@gmail.com>.
You can also submit a unit test patch if you think you can demonstrate a
bug.

Gary

On Mon, Jan 29, 2018 at 2:02 PM, Gary Gregory <ga...@gmail.com>
wrote:

> I replied on SO.
>
> Gary
>
> On Mon, Jan 29, 2018 at 9:59 AM, piyush gajjariya <
> piyush.gajjariya@gmail.com> wrote:
>
>> 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
>>
>
>

Re: [CSV]: Ignore newline in record value while using Apache Common CSV?

Posted by Gary Gregory <ga...@gmail.com>.
I replied on SO.

Gary

On Mon, Jan 29, 2018 at 9:59 AM, piyush gajjariya <
piyush.gajjariya@gmail.com> wrote:

> 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
>