MarcosMeli / FileHelpers

The FileHelpers are a free and easy to use .NET library to read/write data from fixed length or delimited records in files, strings or streams
https://www.filehelpers.net
MIT License
1.13k stars 349 forks source link

Bug in DelimitedField.cs #431

Open FlemmingOstergaard opened 1 year ago

FlemmingOstergaard commented 1 year ago

I have experienced, that if there were more fields in a row, than in the import model AND the first extended field is not quoted it returns and error - "Delimiter '{0}' found ......

I have inserted private ExtractedInfo BasicExtractString(LineInfo line) { if (IsLast && !IsArray) { var sepPos = line.IndexOf(Separator);

            if (sepPos == -1)
                return new ExtractedInfo(line);

            if(IsOptional)
                return new ExtractedInfo(line, sepPos);

and it fixes the problem. I have no experience in submitting this fix, but maybe someone can help to that.