Skip to content

[Delimiter] Consider newline in quote as part of the value #1500

@CHervaudBetclic

Description

@CHervaudBetclic

Hello,

Thanks for this awesome project!

I've tested the csv parser a bit, and it seems that one behavior doesn't match the expected.

We have the quotes parameter on readCsv and readDelimiter methods. From what I've understood, it allows us to consider delimiter chars wrapped inside of quotes as part of the cell value, and not as a real delimiter.
I think the same behavior should be applied for new lines/line breaks.

Example:

COLUMN1,COLUMN2,COLUMN3
value1,value2,value3

Will be parsed as:

COLUMN1 COLUMN2 COLUMN3
value1 value2 value3

But

COLUMN1,COLUMN2,COLUMN3
value1,"value2
part2",value3

Will be parsed as (at least from what I've observed):

COLUMN1 COLUMN2 COLUMN3
value1 value2
part2 value3

I think it should instead be parsed as:

COLUMN1 COLUMN2 COLUMN3
value1 "value2\npart2" value3

Note: When exported a CSV from Excel for example, if cells contains line breaks, they will be formatted as the above example in the exported CSV file.

Let me know if I misunderstood something!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions