all day I\'ve been searching how to resolve this probem and nothing... I want to write function, which convert CSV file to collection of lists (of strings). Here is this fun
In the CsvPreference.EXCEL_PREFERENCE
you've given, the quote character is the "
as described in the javadoc. The quote character is a character you use to wrap special characters that want you want to appear literally.
As such, for these preferences, the appropriate way to produce your CSV content would be
id, name, city, age
1,"""Bob""",London,12
Otherwise, the CSV parser simply thinks
"Bob"
means, literally,
Bob
since there is no other special character between the quotes. But a quote is a special character so if it appears between quotes, it will be considered, literally, as a quote.
Alternatively, provide a different CsvPreference
object which has a different quote character.
Make this decision only after you are certain about what your CSV producer is sending you.