I have a CSV file with a record count row at the end
id|key|limit
123|1|591
456|2|921
record_count|2
When I run this with CsvHelper using a class map it throws an exception when it gets to the record_count|2 row. I'm working around it by configuring a ReadingExceptionOccurred handler to ignore that row.
csvConfig.ReadingExceptionOccurred = ex =>
{
if (ex.Exception.Context.Parser.RawRecord.Contains("record_count"))
{
return false;
}
return true;
};
This works but is there is a more "standard" method for handling this footer record?