ben-strasser / fast-cpp-csv-parser

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

Add possibility to silently ignore CSV's header #14

Closed ghost closed 8 years ago

ghost commented 8 years ago

I didn't find method in CSVReader to ignore CSV's header line. So I add method ignore_header which simply skips one line in the csv file.

ben-strasser commented 8 years ago

Thanks for the patch. However, I have a few questions before merging:

What is the usecase for this function? Is the header of your CSV broken and you therefore need to ignore it? Generally ignoring the CSV header is a bad idea because different CSV files might have the columns in different order.

breznak commented 8 years ago

I agree a broken header should not be ignored. On the other hand, if you willingly want to skip some rows, there's now a CSVReader.readLine() which will skip the row for you. Is your issue resolved with that?