This question is specific to ChoETL CSV reader
Take this example
"Header1","Header2","Header3"
"Value1","Val
ue2","Value3"
- All headers and values are quoted
- There's a line break in "Value2"
I've been playing with ChoETL options, but I can't get it to work:
foreach (dynamic e in new
ChoCSVReader(@"test.csv")
.WithFirstLineHeader()
.MayContainEOLInData(true)
.MayHaveQuotedFields()
//been playing with these too
//.QuoteAllFields()
// .ConfigureHeader(c => c.IgnoreColumnsWithEmptyHeader = true)
//.AutoIncrementDuplicateColumnNames()
//.ConfigureHeader(c => c.QuoteAllHeaders = true)
//.IgnoreEmptyLine()
)
{
System.Console.WriteLine(e["Header1"]);
}
This fails with:
Missing 'Header2' field value in CSV file
The error varies depending on the reader configuration
What is the correct configuration to read this text?