csv-parser
csv-parser copied to clipboard
feature request: std::vector style at() or [] index operator to get a row
it may exists such a smilar API, but I did not see it in my scan. thank you!
The parser might not load the entire file at once if it's large, and once it reads a row, it discards it (unless you save it), so a random access [] operator can't be really be done.
Whenever I want to grab a specific row, I would just use a for loop with a counter variable. Furthermore, it would be pretty easy to just write a function that save all rows that a CSVReader produces into an std::vector.
Note that if you have a CSVRow row then you can use the conversion operator std::vector<std::string>(row).