Cannot parse csv file if it have only one column and default delimiter in rows
Is your feature request related to a problem? Please describe. We cannot parse csv file, when we have only one column and commas in rows. Eg: column1 test1 test2 test3 test4,test4 test5
Describe the solution you'd like We would use auto detect delimiter. CSVHelper should ignore commas in rows because we have only one column.
Describe alternatives you've considered Manual seting "NoDelimiter" as delimiter. For now - we cannot set delimiter as "" because it throws error in line 176 in CsvParser.cs
If you have only a single column, why do you want to detect the delimiter? There isn't one to detect.
You could set the delimiter to some character that you know will never be used. Just pick some obscure Unicode character that will never be in your file.
Well - I have app which we parse lots of csv files: eg. 1000. Some have delimiter, some don't. That's why I use auto detect delimiter.
"You could set the delimiter to some character that you know will never be used. Just pick some obscure Unicode character that will never be in your file." I can't do that while parsing (when I found only one column when I read header), because variable delimiterFirstChar is private and its set only on ctor of CSVParse. If I'll change this variable then I can solve this problem, but for now I can't :(
Before you run the file through CsvHelper, read the first line in and determine if it's a single column file, then set the config accordingly.
For me to do this in CsvHelper, I would have to read part of the file, then start over again. This really isn't possible due to CsvHelper only having access to a TextReader. You being the holder of the TextReader can.