#include <iostream>
#include <string>
using namespace std;
int main(int argc, _TCHAR* argv[])
{
FILE* pfile = fopen("D:\\origin.txt", "rb");
if (!pfile) return false;
fseek(pfile, 2, 0);
wchar_t buf[1024];
wstring line;
wstring newl = L"\x000D\x000A";
while (!feof(pfile)) {
fgetws(buf, 1024, pfile);
line = buf;
if(line.find(newl)!=wstring::npos) line = line.substr(0, line.find(newl));
}
fclose(pfile);
}
原文:http://www.cnblogs.com/chunyou128/p/4567734.html