I have data files with extra empty lines in them at the end. This is causing problems with reading in the data lines. I'm using:
while (datFile.good())
but .eof() didn't work either.
Any suggestions?
while (datFile.good())
{
getline (datFile, line);
istringstream liness(line);
int z = 0;
while (z <= index)
{
while (liness >> temp)
{
if (z == 0)
{
values[0].push_back(atof(temp.c_str()));
}
if (z == index)
{
values[1].push_back(atof(temp.c_str()));
}
cout << temp << endl;
z++;
}
}
}