Replies: 1 comment
-
I answered your question on StackOverflow. https://stackoverflow.com/questions/61107278/csvhelper-c-list/61123883#61123883 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to read multiple records types from a csv file where the first line have following records
id, name, Number of values
and the second line have
date, shift, values[0..n], quality
With the help from original csvhelper example i can read the original lines but i can not figure out how to pass BarMap the number of values that need to be aggregated and then how to sum them up.
fooRecords.Add(csv.GetRecord()); Foo.numValue <- Number of values
barRecords.Add(csv.GetRecord());
public sealed class BarMap : ClassMap
{
public BarMap()
{
Map(m => m.date).Index(1);
Map(m => m.shift).Index(2);
//Aggregation of values 1 ..n goes here
Map(m => m.quality).Index(n+1);
}
I would appreciate if anyone can help me in this.
Beta Was this translation helpful? Give feedback.
All reactions