C++,如何从.CSV文件中逐行读取数据???急!!!
如何从.CSV文件中逐行读取数据???急!!!
例如:
string LineData;
fstream file ;
file.open(FilePath,ios_base::out|ios_base::in);
if(!file.is_open())
cerr<<"the file open error!!"<<endl;
while((ch = cin.getline()) != EOF){ //judge file EOF or not!!
file.getline(file,LineData,'');
}
file.close();
本想利用getline函数逐行读取数据,但是不知道第三个参数该如何写,因为CSV文件的
行结束符是CRLH;有没有其他的方法解决,请高手赐教!!