I have only sought and soon found the following (which I must add find_first_of ()?:
Code:
// reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string line;
ifstream myfile ("example.txt");
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
cout << line << endl;
string::size_type found = line.find_first_of("\t");
}
}
myfile.close();
}
else cout << "Unable to open file";
return 0;
}
This file does the rest typically like this:
Code:
0.0 1.234 1.2434
0.1 1.343 1.4533
0.2 1.454 1.3534
...osv
Bookmarks