FileHelpers icon indicating copy to clipboard operation
FileHelpers copied to clipboard

Bug in DelimitedField.cs

Open FlemmingOstergaard opened this issue 1 year ago • 0 comments

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.

FlemmingOstergaard avatar Apr 24 '23 22:04 FlemmingOstergaard