Describe the bug
Delimiter autodetection fails in short csv that have multiple empty lines in the end
To Reproduce
var lines = new List<string>() {
"A;B;C;D",
"1;2;3;4",
"1;2;3;4",
"1;2;3;4",
"",
"",
"",
};
var text = string.Join("\r\n", lines);
using var csv = new MemoryStream(Encoding.UTF8.GetBytes(text));
using var reader = new StreamReader(csv);
using var parser = new CsvParser(reader, new CsvConfiguration(CultureInfo.InvariantCulture) { DetectDelimiter = true});
parser.Read();
Console.WriteLine(parser.Delimiter); // writes ","
Expected behavior
In the example the parser should detect ";". These empty lines should be ignored.
using var parser = new CsvParser(reader, new CsvConfiguration(CultureInfo.InvariantCulture) {
DetectDelimiter = true,
IgnoreBlankLines = true // Does it help?
});
Describe the bug Delimiter autodetection fails in short csv that have multiple empty lines in the end
To Reproduce
Expected behavior In the example the parser should detect ";". These empty lines should be ignored.