skip to Main Content

Convert CSV with nested JSON object to JSON

I have a sample CSV message: header1,header2,header3 value1,value2,{"name":"John","age":30,"car":null} How to convert it in form of embedded JSON as in: { "header1": "value1", "header2": "value2", "header3": "{"name":"John","age":30,"car":null}" } I am using Jackson schema builder with default column separator: CsvSchema.builder().disableQuoteChar().setUseHeader(true).build(); CsvMapper.builder().enable(CsvParser.Feature.IGNORE_TRAILING_UNMAPPABLE, CsvParser.Feature.WRAP_AS_ARRAY).build();

VIEW QUESTION
Back To Top
Search