kotlin-csv icon indicating copy to clipboard operation
kotlin-csv copied to clipboard

Unable to parse with multiple quotes

Open rverma-dev opened this issue 2 years ago • 1 comments

Describe the bug trying to parse a csv record as """Permits complete"" received";;Phase 3 : 067f65dc7dc7f703229bcb7b3b21d9 , c227adc4c8ab8854dd8cc5764ce63deb1b with delimiter ',' and escape char ''

getting an error as com.github.doyaaaaaken.kotlincsv.util.CSVParseFormatException: must appear delimiter or line terminator after quote end [rowNum = 6, colIndex = 31, char = ;]

Expected behavior Expect that the csv parser reads 2 cells

  1. """Permits complete"" received";;Phase 3 : 067f65dc7dc7f703229bcb7b3b21d9
  2. c227adc4c8ab8854dd8cc5764ce63deb1b

rverma-dev avatar Aug 16 '23 13:08 rverma-dev

To add to this, here is a reproducible example:

    @Test
    fun `test double quotes csvParser`() {
        // throws exception currently
        val csv = """
            " ""T"" ", "t"
        """.trimIndent()
        csvReader().readAll(csv)
    }

Edit: after code inspection this issue is unrelated to double quotes but has to do with parser not handling space between columns.

korri123 avatar Jan 23 '24 16:01 korri123