csv-parser
csv-parser copied to clipboard
Fast, header-only, extensively tested, C++11 CSV parser
Sorry, my English is not good. I have a csv file with two empty lines. | | |:-| | | when I run the below code: ``` auto field =...
I have tested about 25 different CSV parsers and this one was the best performing of them all. Thank you for writing a parser that is efficient.
## Description When constructing a parser a `std::istream` referenced is used and stored. However, the lifecycle of the `std::istream` can be shorter than the parser, leaving it with a stale...
explicit CsvParser(std::istream& input) : m_input(input) { // Reserve space upfront to improve performance m_fieldbuf.reserve(FIELDBUF_CAP); if (!m_input.good()) { throw std::runtime_error("Something is wrong with input stream"); } }
To fix this problem Change else if (!inquotes && (c == '\r' || c == '\n')) to else if (!inquotes && (c == '\r' || c == '\n' || in.eof()))...
Call this static method to detect the UTF8 BOM and skip it. Call it on the stream before using CsvParser. Example usage: std::ifstream isInfoDB(pathInfoDB); if (!aria::csv::CsvParser::ReadUtf8_BOM(isInfoDB)) { AfxMessageBox(L"The file needs...
The parser wasn't recognizing the last field in a row, if that row: - doesn't end with a newline - has an empty string as last field Should also address...