I've got an application on my hands that uses the FileHelpers library to process csv files.
In the past, the input csv files always had the same structure, 5 comma-separated fields for a record, then a new line to delimit records.
Recently, however, I started receiving csv files that have more than five records per line, and, apparently, the class that is currently used for csv parsing isn't applicable for these lines. The thing is, I still only need the first five fields, which are still supplied in he same order.
Is there any way to read the first five fields with FileHelpers, and ignore any other data until a newline?
The class currently used for parsing:
[IgnoreEmptyLines()]
[DelimitedRecord(";")]
public sealed class SemicolonsRow
{
[FieldQuoted('"', QuoteMode.OptionalForRead, MultilineMode.AllowForRead)]
public String LastName;
[FieldOptional()]
[FieldQuoted('"', QuoteMode.OptionalForRead, MultilineMode.AllowForRead)]
public String Name;
[FieldOptional()]
[FieldQuoted('"', QuoteMode.OptionalForRead, MultilineMode.AllowForRead)]
public String MidName;
[FieldOptional()]
[FieldQuoted('"', QuoteMode.OptionalForRead, MultilineMode.AllowForRead)]
public String BirthDate;
[FieldOptional()]
[FieldQuoted('"', QuoteMode.OptionalForRead, MultilineMode.AllowForRead)]
public String BirthPlace;
}