CSVMapper and CSVSchema throwing error for Quotes

839 Views Asked by At

I am getting error when I try to parse my csv file, This is error

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('s' (code 115)): Expected separator ('"' (code 34)) or end-of-line

and this is my csv file line that throws the error

SOME NAME|BULGARIA|123444|"abc def ghijkl, abcdef abcd abc., efg, 8 "hi. jk. lmnopqrst" abcd, we-2636 abcdffe, bulgaria"|0|Abcdef ghui Llmnopqres.|"0 "hi. jk. Wertyyi" abcd"|Abcdef|""|WE-2636|yahoo|call|"123444|1|Abcd"|WE_4981878

Sorry for the long line

Here is syntax

csvSchema = csvMapper.schemaFor(User.class)
                    .withUseHeader(true)
                    .withColumnSeparator("|")
                    .withQuoteChar('\"')

But this is not working but the same syntax is working for "Aple \"Abcd Abcd Abcdefghijk\"" Also I can't use withoutQuoteCharbecause my line contains "123444|1|Abcd"

0

There are 0 best solutions below