ChoETL icon indicating copy to clipboard operation
ChoETL copied to clipboard

Issue with a double-quotes used in an enclose fields.

Open msaeli opened this issue 1 year ago • 1 comments

Hello @Cinchoo ,

First of all thank for all the great work done on this library. I might have found an issue with the " handling in string double quoted.

Data source:

,"Some Value In My Column""With Two Double Quotes",

I do expect the following result :

Some Value In My Column"With Two Double Quotes --> 47 Char

But ChotETL output the following value

Some Value In My Column""With Two Double Quotes --> 48 Char

The version used is : 1.2.1.68

Did I miss a something in the configuration ?

I am referring to this RFC --> RFC-4180

  1. If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example:

    "aaa","b""bb","ccc"

Best regards,

msaeli avatar Feb 18 '25 14:02 msaeli

Use MayHaveQuotedFields() in parser

using (var parser = new ChoCSVReader(FileNameNestedQuotesCSV)
    .MayHaveQuotedFields())
{

}

Cinchoo avatar Mar 04 '25 14:03 Cinchoo