ben-strasser/fast-cpp-csv-parser

member `file_line` is not actually used for normal logic inside LineReader, making set_file_line effectively useless

Closed this issue · 1 comments

Needed to set the line in a csv file,

io::CSVReader<1> csv_file(file_path);
csv_file.read_header(io::ignore_extra_column, "\"my_column\"");

unsigned int line_number = 3;
// +1 to avoid header
csv_file.set_file_line(line_number+1);
std::cout << "line_number + 1: " <<line_number + 1 << std::endl; //4
std::cout << "file line: " << csv_file.get_file_line() << std::endl; // 4
double my_column;
csv_file.read_row(my_column); //only reads first line. 
std::cout << "file line: " << csv_file.get_file_line() << std::endl; //5 which is expected
csv_file.read_row(my_column); //but this will get the second line?, so there is some other variable handling the true line number. 

Found out that, while line number itself is properly updated, no where in the next line function, or indeed in the entire csv.h header file does file_line actually correspond to internal logic, ie, it doesn't effect the actual line number underneath.

If this isn't correct, please correct me with the appropriate information, but AFAICT, it is only used for error handling, it doesn't effect the actual line I'm trying to read from the CSV file.