ben-strasser/fast-cpp-csv-parser

Parse Single Line Without Loading File

Closed this issue · 3 comments

Is there a way to parse just a single std::string row without loading a file?

It looks like the linereader class constructors all want filepaths, but I have a std::string with the row that I need to parse. Does this library provide a way to parse this?

Example:

std::string csvRowText = aRowFromCSVFile;
LineReader(csvRowTest);
//get the data points from that row below

Ok, I see.

Can you provide a small example on using this LineReader constructor to read CSV data similar to my usecase if its no trouble? I'm just a bit confused on how to actually get it up and running

vector<char>buffer;
LineReader("string used as file name in error messages", buffer.data(), buffer.data()+data.size());