I am using FileHelpers to import data from a CSV file. Problem is, some versions of the CSV file have more fields than others.
As such, I have marked the fields that are sometimes missing as being optional, but this does not seem to work as instead of just ignoring when fields are missing (which it seems to do ok) it is also always chopping the last character off of the last field that is present.
For example...
My record format is defined as follows...
[DelimitedRecord(@",")]
public class RecordFormat {
[FieldTrim(TrimMode.Both)]
public String FirstValue;
[FieldTrim(TrimMode.Both)]
public String SecondValue;
[FieldOptional]
[FieldTrim(TrimMode.Both)]
public String OptionalValue;
}
Can anybody suggest what it is I am missing?
Thanks.
Look like a bug in which seems to be fixed in the latest version 2.9.9
See link at http://www.filehelpers.com/forums/