I have the following CSV format:
id,name,description,age
23,Anna,"Self-made
Chef
Shoemaker",23
The double-quotes are only present if the attribute is multi-line. While I am already been able to read the normal CSV correctly:
@Bean
public CsvMapper csvMapper() {
CsvMapper csvMapper = new CsvMapper();
csvMapper.registerModule(new JavaTimeModule());
csvMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
return csvMapper;
}
I tried adding a new feature:
csvMapper.configure(Feature.FAIL_ON_MISSING_COLUMNS, true);
But it makes the library skip failed rows. How do I parse the given format and get the whole Self-made\n Chef\n Shoemaker
into the description attribute?