3 ms·
CSV is still easier to parse because the C++ dudes still refuse to implement some kind of nice operator-overloaded interface like #include <json> std:
by dheera 5y ago
CSV is still easier to parse because the C++ dudes still refuse to implement some kind of nice operator-overloaded interface like
#include <json>
std::json myjson("{\"someArray\": [1,2,3,4,{\"a\": \"b\"}]}");
std::cout << (std::string)myjson["someArray"][4]["a"];
and the result is we have 50 different rogue JSON libraries instead of an STL solution. Until the STL folks wake up, boost::split can deal with the CSV.
- mivade 5y agohttps://github.com/nlohmann/json https://github.com/nlohmann/json
- RodgerTheGreat 5y agoA string split function is a poor choice if there's any possibility the CSV file contains quoted fields. Robust handling of both CSV and JSON requires a parser. In my experience, CSV can actually be trickier than JSON to parse because there are so many edge cases, alternatives, and ambiguities.
- deleted 5y ago[deleted]