There a many ways to achieve this. Here is one that uses QTextStream to worry about finding the white space delimiter:
Qt Code:
  1. #include <QtCore>
  2. #include <QDebug>
  3.  
  4. int main(int argc, char* argv[])
  5. {
  6. QCoreApplication app(argc, argv);
  7.  
  8. QFile in("/tmp/data.txt");
  9. if (in.open(QIODevice::ReadOnly)) {
  10. QTextStream s(&in);
  11. while (!s.atEnd()) {
  12. QString dummy, value;
  13. s >> dummy; // ignore the first field
  14. s >> value;
  15. dummy = s.readLine(); // ignore the remainder of the line
  16. qDebug() << value;
  17. }
  18. in.close();
  19. }
  20. }
To copy to clipboard, switch view to plain text mode 

No matter what approach you take you have to read the entire line in order to get to the next line.