以下の内容はhttps://shuzo-kino.hateblo.jp/entry/2018/10/24/235501より取得しました。


boostライブラリでCSVをパース

boostはC++標準委員の中の人が関わってつくった、最強ライブラリです。
数学系やパーサー系の強力なのが揃っています。

実際のところ

#include <iostream>
#include <string>
#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>
using namespace std;

typedef boost::tokenizer< boost::escaped_list_separator<char> >
BOOST_TOKENIZER_ESCAPED_LIST;

void dump(BOOST_TOKENIZER_ESCAPED_LIST &tokens)
{
        BOOST_FOREACH(string s, tokens) {
                cout << "<" << s << "> ";
        }
        cout << endl;
}

int main(int argc, char *argv[])
{
        string str1("12,34\n56,78\n");

        BOOST_TOKENIZER_ESCAPED_LIST tokens1(str1);
        dump(tokens1);

        return 0;
}



以上の内容はhttps://shuzo-kino.hateblo.jp/entry/2018/10/24/235501より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14