Usage of set_file_line is not clear
Closed this issue · 1 comments
Use case: I need to read the same CSV file multiple times.
Problem: After I went through the CSV file the first time, I would like to go back to the beginning (line 0). When I use set_file_line(0), the internal state of LineReader (given by the variable data_begin I think) does not change. Hence, read_row() (and with that next_line()) finds the condition data_begin == data_end, meaning that a nullpointer is returned and not the correct data for the set line.
Am I using set_file_line incorrectly or is it an implementation issue? Thank you for your help :)
The functions only affect the error message. The naming is bad but changing this could break people. I added a comment to the readme.
They were written for edge cases where there is some boilerplate before the actual header (like # style comments or so) and you do not want to count them. If you actually want to switch files, create a new reader.