CsvReader icon indicating copy to clipboard operation
CsvReader copied to clipboard

error in parsing while " is firs char in row text and " is a part of column text

Open kashiash opened this issue 6 years ago • 2 comments

this row is parsed correctly:

6224613;SINUS POLSKA, MIEDZYRZECZ;

this is not parsed correctly: 6224613;"SINUS POLSKA", MIEDZYRZECZ;

but this is parsed corectly too:

6224613;SINUS "POLSKA", MIEDZYRZECZ;

this means that if column contains " at first character then i get error ... the csv is created by external source and i cant change this

kashiash avatar May 10 '18 16:05 kashiash

Looks like it might be a bug - see if this case is covered off by a unit test

phatcher avatar May 11 '18 09:05 phatcher

https://github.com/phatcher/CsvReader/pull/61

I checked this issue, and it's as follow: If you have quote at the beginning of your field, then parser expects that next quote will be field closing quote. The only case for test to pass is to escape quote inside and add quote at the end of field like this: "good,Also"good","wrong""Field",goodToo". In that case wrong Field will be parsed properly. I will try to work on it if I may.

jakubmaguza avatar Oct 14 '18 18:10 jakubmaguza