ben-strasser / fast-cpp-csv-parser

fast-cpp-csv-parser
BSD 3-Clause "New" or "Revised" License
2.12k stars 439 forks source link

reuse variable #8

Closed raulvc closed 8 years ago

raulvc commented 8 years ago

I know it's probably a bad design but I'm trying to find a way to reuse an existing CSVReader instance for reading another file so that I can treat a lot of csv files as a single merged file, any ideas? (I can't iterate on a list of files either as there's no offset setting on the library to return to last read row when I have to stop the iteration midway)

ben-strasser commented 8 years ago

Do you have lines that span across multiple files?

If not, then why not doing sometime along:

string file_list[] = {...}; for(const auto& x:file_list){ CSVReader<3>in(x); in.read_header(...); while(in.read_row(...)){

 }

}