And one implication of the problem above is that a two steps parsing (which is my case) is going to fail with com.opencsv.exceptions.CsvMalformedLineException: @Test void twoStepsParsing() throws IOException, CsvException { CSVParser firstStepParse = new CSVParserBuilder() .withSeparator(',') .withQuoteChar('"') .withIgnoreQuotations(false) .withStrictQuotes(false) .build(); CSVParser secondStepParse = new CSVParserBuilder() .withSeparator('|') .withQuoteChar('"') .withIgnoreQuotations(false) .withStrictQuotes(false)...
Hi Scott! Sorry! Here you are a working example of the problem: @Test void bug() throws CsvValidationException, IOException { CSVParser parser = new CSVParserBuilder() .withSeparator(',') .withQuoteChar('"') .withIgnoreQuotations(false) .withStrictQuotes(false) .build(); String data = "a=1|b=2,c=\"x\"|d=\"y\""; // ^ // The scaped double quote after y will be removed after parsing String[] expected = { "a=1|b=2", "c=\"x\"|d=\"y\"" }; String[] actual = new CSVReaderBuilder( new StringReader(data))...
Hi Scott! Sorry! Here you are a working example of the problem: @Test void bug() throws CsvValidationException, IOException { CSVParser parser = new CSVParserBuilder() .withSeparator(',') .withQuoteChar('"') .withIgnoreQuotations(false) .withStrictQuotes(false) .build(); String data = "a=1|b=2,c=\"x\"|d=\"y\""; String[] expected = {"a=1|b=2", "c=\"x\"|d=\"y\""}; // ^ // The double quote after y will be removed after parsing String[] actual = new CSVReaderBuilder( new StringReader(data)) .withCSVParser(parser)...
Quote char at the end of string incorrectly removed from last token during parsing