timmu
8th August 2012, 11:25
Hi,
My input file (a csv text file) was created with a Mac. Since Mac uses different line breaks my application which runs in Windows or Linux cannot properly read the file line by line (it reads the entire row). I know this used to be a bug in Qt. Has it been fixed? Can I now read Mac files (with Mac line braks) if my program runs on windows. This is how I do it:
QFile infile(Filename); if(!infile.open(QIODevice::ReadOnly | QIODevice::Text)) {exit(1);}
QTextStream in_stream(&infile);
while(!in_stream.atEnd())
{
QString row = in_stream.readLine();
}
infile.close();
My input file (a csv text file) was created with a Mac. Since Mac uses different line breaks my application which runs in Windows or Linux cannot properly read the file line by line (it reads the entire row). I know this used to be a bug in Qt. Has it been fixed? Can I now read Mac files (with Mac line braks) if my program runs on windows. This is how I do it:
QFile infile(Filename); if(!infile.open(QIODevice::ReadOnly | QIODevice::Text)) {exit(1);}
QTextStream in_stream(&infile);
while(!in_stream.atEnd())
{
QString row = in_stream.readLine();
}
infile.close();