如果嵌入的双引号字符由双引号字符对表示,是否可以使用c ++ boost tokenizer解析CSV?
Wiki的文章Comma-separated values说每个嵌入的双引号字符必须用一对双引号字符表示,并提供以下csv文件示例:
Year,Make,Model,Description,Price
1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""","",4900.00
1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00
1996,Jeep,Grand Cherokee,"MUST SELL!
air, moon roof, loaded",4799.00
默认的boost tokenizer typedef tokenizer< escaped_list_separator<char> > tokenizer;
会删除嵌入式配额,但如果使用\“而不是”“则可以正常工作。