I\'m trying to parse this type of CSV file with FileHelpers:
Tom,1,2,3,4,5,6,7,8,9,10
Steve,1,2,3
Bob,1,2,3,4,5,6
Cthulhu,1,2,3,4,5
Greg,1,2,3,4,5,6,7,8,9,10
You can use an Array Field and the library will do the work:
[DelimitedRecord(",")]
public class MyRecord
{
public string Name;
public int[] Values;
}
You can even use [FieldArrayLength(2, 8)]
[DelimitedRecord(",")]
public class MyRecord
{
public string Name;
[FieldArrayLength(2, 8)]
public int[] Values;
}
The set the min/max number of values
I strongly recomend to download the last version of the library from here:
http://teamcity.codebetter.com/viewType.html?buildTypeId=bt65&tab=buildTypeStatusDiv
Check the artifacts section