kavitha edula
kavitha edula

Reputation: 9

Jackson data bind CSV reader : not reading parenthesis

String in the csv has ( & ) special chars - unable read
example : US - Standard Pkg xyz (Band 28 & Below) 6 Panel

val csvMapper = CsvMapper().apply {
                enable(CsvParser.Feature.TRIM_SPACES)
                enable(CsvParser.Feature.SKIP_EMPTY_LINES)
                enable(CsvGenerator.Feature.ESCAPE_CONTROL_CHARS_WITH_ESCAPE_CHAR)
            }
            csvMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        val schema = CsvSchema.builder().addColumn("xyzzz")

 schema.usesEscapeChar()
            var readerCandidate: ObjectReader = csvMapper.readerFor(POJOclass::class.java).with(schema.withSkipFirstDataRow(true))
            data = readerCandidate.readValues<POJOclass>(inputStream.inputStream()).readAll()


need read and map the (,), & and all special characters to pojo from CSV example US - Standard Pkg xyz (Band 28 & Below) 6 Panel

Upvotes: 0

Views: 46

Answers (0)

Related Questions