从csv文件读取数据到二维vector
2024-09-30 21:03:32
void ReadDataFromCsv(std::string &filename, std::vector<std::vector<std::string> > &lines_feat) {
std::ifstream vm_info(filename.c_str());
std::string lines, var;
std::vector<std::string> row; lines_feat.clear(); while(!vm_info.eof()) {
getline(vm_info, lines);
if(lines.empty())
break;
std::istringstream stringin(lines);
row.clear(); while(std::getline(stringin, var, ',')) {
row.push_back(var);
}
lines_feat.push_back(row);
}
}
最新文章
- 【JUC】JUC锁框架综述
- Lua 学习笔记(一)环境搭建
- [Linux]安装phpredis扩展
- hdu 5833 Zhu and 772002 高斯消元
- Struts2 实现文件上传和下载
- CentOS6.3连网获取IP失败 This device is not active
- Nginx + IIS
- 命令查看服务器SN号
- 常见.NET功能代码汇总 (3)
- GDAL1.11版本对SHP文件索引加速测试
- DAY20 常用模块(三)
- KFCM算法的matlab程序
- MT【48】分式连加形式下求不等式解集的区间长度
- 关于Altium Designer 提示发送错误报告解决方法
- CSS 标签实例二
- C#里面const和readonly
- Spring下获取项目根路径--good
- [Luogu3733][HAOI2017]八纵八横
- Python3 匿名函数
- 【POJ】1094 Sorting It All Out(拓扑排序)
热门文章
- 找到多个与名为“Home”的控制器匹配的类型。
- [Wf2015]Tours
- hihoCoder#1069 最近公共祖先&#183;三
- 游走(bzoj 3143)
- The Java library for converting Wikipedia wikitext notation to HTML
- go语言中的timer 和ticker定时任务
- hdu 4291 矩阵幂 循环节
- log4j 具体解释
- 演练:我的第一个 WPF 桌面应用程序 https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application
- Java实现二叉排序树的插入、查找、删除