您的位置:首页 > 编程语言 > C语言/C++

CSV文件C++操作库:MiniCSV

2015-12-11 17:30 471 查看
MiniCSV 是一个基于c++文件流的小巧而灵活的 CSV 库。


Writing

We see an example of writing tab-separated values to file usingcsv::ofstreamclass. Tab is a perfect separator to use because it seldom appear in the data. I have once encountered a comma in company name which ruined the CSV processing.

?
NEWLINEis defined as'\n'. We cannot usestd::endlhere becausecsv::ofstreamis not derived from thestd::ofstream.

回到顶部


Reading

To read back the same file,csv::ifstreamis used andstd::coutis for displaying the read items on the console.

?
The output in console is as follows.
Shampoo,200,15 Soap,300,6


项目主页:http://www.open-open.com/lib/view/home/1427182646824
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: