C++文件读写
来源:互联网 发布:大数据,银行风险 编辑:程序博客网 时间:2024/06/07 07:11
std::string strDir = std::string(szSetPath) + std::string("\\out.txt");ifstream ifs;ofstream ofs(strDir.c_str());vector<string> csv_vec = statdir.BeginBrowseFilenames("*.*");static int csv = 0;for(vector<string>::const_iterator it = csv_vec.begin(); it < csv_vec.end(); ++it){string strTemp = *it;if (strTemp.find("fix.csv") != string::npos){ifs.open(strTemp);if (!ifs.rdbuf()->is_open()){// 打开文件错误}// 取文件大小ifs.seekg(0,std::ios::end);int nLen = ifs.tellg();char* pBuffer = new char[nLen];if (pBuffer == NULL){// }memset(pBuffer ,0,nLen);// 恢复游标ifs.seekg(0);ifs.read(pBuffer,nLen);if(ifs.gcount() != nLen){//}CString strFind(pBuffer);strFind.Replace(sztmp, "");strFind.Trim();strFind += "\n";ofs.write(strFind, strFind.GetLength());delete []pBuffer;csv++;ifs.close();}}ofs.close();
0 0
- 【C/C++】文件读写
- c语言读写文件
- 文件读写(c)
- C#-读写INI文件
- [C++]文件读写操作
- C#读写INI文件
- C 读写文件
- C读写ini文件
- c#FileStream文件读写
- 读写文件 c
- WinAPI C读写文件?
- C语言读写文件
- 文件读写(C++)
- c中的文件读写
- C文件读写
- c读写文件
- c读写Exc文件
- C/C++ 读写文件
- 机房收费系统----状态图
- Leetcode -- The Skyline Problem
- django.forms-Widget和Media间的联系
- matlab linprog函数的使用
- android 签名和混淆打包
- C++文件读写
- @Autowired 注释与@Qualifier 注释
- Android View的事件分发机制
- NLP 最近常用分词工具
- 用“*”画余弦曲线从0度到360度
- django.forms.widget-ChoiceInput
- AutoCompleteTextView 自动提示的用法
- PAT Advanced 1014
- Linux操作系统中,*.zip、*.tar、*.tar.gz、*.tar.bz2、*.tar.xz、*.jar、*.7z等格式的压缩与解压