You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to process a file that contains five columns:
Column1,Column2,Column3,Column4,Column5
I only want to grab certain columns but LinqToCSV errors out when it attempts to parse the file because Column1 is a string and Column2 is an int. The file does not contain headers so I would expect I could just specify the FieldIndex and it would grab from the correct position. My model is like such:
public class Foo {
[CsvColumn(FieldIndex = 2)]
public int Id;
}
So I would expect Column2 data to appear in the Id property but LinqToCSV tries to place Column1 data in Id. It looks like it is purely used for ordering the columns but they still all need to be present. It would be nice if the FieldIndex actually correlated to the position of the data we wish to store in our model.
The text was updated successfully, but these errors were encountered:
I am attempting to process a file that contains five columns:
Column1,Column2,Column3,Column4,Column5
I only want to grab certain columns but LinqToCSV errors out when it attempts to parse the file because Column1 is a string and Column2 is an int. The file does not contain headers so I would expect I could just specify the FieldIndex and it would grab from the correct position. My model is like such:
public class Foo {
[CsvColumn(FieldIndex = 2)]
public int Id;
}
So I would expect Column2 data to appear in the Id property but LinqToCSV tries to place Column1 data in Id. It looks like it is purely used for ordering the columns but they still all need to be present. It would be nice if the FieldIndex actually correlated to the position of the data we wish to store in our model.
The text was updated successfully, but these errors were encountered: