I don't think the library is capable of doing so directly. You have to read your column from individual fields and add them to a List
, but the process is usually fast because readers do job fast. For example if your desired column is of type string
, the code would be like so:
List<string> myStringColumn= new List<string>();
using (var fileReader = File.OpenText(inFile))
using (var csvResult = new CsvHelper.CsvReader(fileReader))
{
while (csvResult.Read())
{
string stringField=csvResult.GetField<string>("Header Name");
myStringColumn.Add(stringField);
}
}