You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have value inside quotes and escaped quotes placed before separator, then parse result would be wrong
test case:
var csv = @"John,Doe,120 any st.,""\""Anytown\"", WW"",08123";
var readerConfiguration = new ExcelReaderConfiguration
{
FallbackEncoding = Encoding.UTF8,
AutodetectSeparators = new [] { ',' }
};
await using var stream = new MemoryStream(Encoding.UTF8.GetBytes(csv));
using var reader = ExcelReaderFactory.CreateCsvReader(stream, readerConfiguration);
reader.Read();
var values = Enumerable.Range(0, reader.FieldCount).Select(it => reader[it]);
Console.WriteLine(string.Join("\n", values));
actual output:
John
Doe
120 any st.
\Anytown\"
WW"
08123
expected output:
John
Doe
120 any st.
"Anytown", WW
08123
The text was updated successfully, but these errors were encountered:
We probably need to add a setting for configuring what escape character to use instead of double quotes ('"')? Can't think of a good way to autodetect it.
Creating a csv file using Excel with the values from your expected output instead gave me this:
John,Doe,120 any st.,"""Anytown"", WW",8123
Which gave me the following output using your test case (changed to read from file instead of inline):
version 3.6.0
If we have value inside quotes and escaped quotes placed before separator, then parse result would be wrong
test case:
actual output:
expected output:
The text was updated successfully, but these errors were encountered: