Given I use hasHeaders: true for CsvReader constructor and want to manually specify columns with correct types, _fieldHeaderIndexes doesn't get populated that results in broken GetFieldIndex method.
Because given hasHeaders = true the _fieldHeaderIndexes gets populated (line 1592) only when no Columns have been added before.
My workaround is to initialize CsvReader with hasHeaders: false and then use csv.ReadNextRecord() before while loop:
while (csv.ReadNextRecord()) { ... }
Given I use
hasHeaders: true
forCsvReader
constructor and want to manually specify columns with correct types,_fieldHeaderIndexes
doesn't get populated that results in broken GetFieldIndex method.Because given
hasHeaders = true
the_fieldHeaderIndexes
gets populated (line 1592) only when noColumns
have been added before.My workaround is to initialize CsvReader with
hasHeaders: false
and then usecsv.ReadNextRecord()
before while loop:while (csv.ReadNextRecord()) { ... }