In earlier versions of CsvHelper, I could set the default delimiter like this:
using var csv = new CsvReader(reader, CultureInfo.CurrentCulture);
csv.Configuration.Delimiter = "~";
How do I do this same thing in the current version (version 22)?
After a bit of Googling, I found this post in the CsvHelper issues. So, in the context of my original question, the correct code is now:
var config = new CsvConfiguration(CultureInfo.CurrentCulture) { Delimiter = "~" };
using var csv = new CsvReader(reader, config);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With