CSV文件C++操作库:MiniCSV
2015-12-11 17:30
471 查看
MiniCSV 是一个基于c++文件流的小巧而灵活的 CSV 库。
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.
回到顶部
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.
项目主页:http://www.open-open.com/lib/view/home/1427182646824
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.?
回到顶部
Reading
To read back the same file,csv::ifstreamis used andstd::coutis for displaying the read items on the console.?
Shampoo,200,15 Soap,300,6
项目主页:http://www.open-open.com/lib/view/home/1427182646824
相关文章推荐
- C语言合法标识
- C++ vector 经常用到的小知识
- GNU g++4.8.4编译支持c++11标准
- C++输入输出
- C++函数指针
- C语言学习总结(四) 剩余内容
- 第一个c语言程序
- scanf函数详解
- leetcode----Longest Substring Without Repeating Characters
- c++ 植物类 继承多态 菱形继承
- C语言文件操作详解
- C语言中的static 详细分析
- 二叉搜索树(BST) ---- C语言
- [C++]类模板在何时实例化?
- C++第11版本中的一些强大的新特性小结
- C++多态技术的实现和反思
- vs2010 C++静态编译
- C++ Primer Plus第六版 第十六章 编程练习答案
- Loadruuner C语言脚本--如何引用DLL文件
- c++实现hashtable缓存