When i run my program i get a long string of numbers and letters when i should be getting normal data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
ifstream fin;
fin.open("data.txt");
if(!fin)
{
cout << "Error opening file. Closing." << endl;
exit(1);
}
for (int i = 0; i< COUNT; i++)
{
fin >> arrayOne[i]
for (int j= 0; j< COUNT_TWO; j++)
{
fin >> arrayTwo[i][j]
}
}
fin.close();
|
Here is the raw .txt data
2002
2.4 2.7 2.7 2.9 2.8 3.4 3.4 2.2 .9 1.1 1.7 1.9
2003
2.2 2.9 3.3 3.3 3.1 3.3 3.3 2.6 1.5 1.4 1.8 1.8
2004
2.2 2.7 3.1 3.8 3.6 4.0 3.6 2.9 1.7 1.8 2.4 2.1
2005
2.0 2.2 2.2 2.6 2.8 3.2 2.8 2.3 1.2 1.3 2.0 1.9
2006
2.0 2.2 2.2 2.6 2.9 3.1 2.4 1.7 1.0 1.9 2.3 1.9
2007
2.6 2.6 2.4 2.4 2.6 3.1 3.2 3.1 2.0 2.1 2.7 2.6
2008
2.3 2.5 2.2 2.3 2.5 2.5 1.7 1.7 1.0 1.3 1.5 1.9
2009
2.1 2.2 2.4 2.4 3.1 2.7 1.9 1.5 .9 1.9 2.7 2.3
Now i cannot figure out what is doing this. Any hints? My only guess right now is it has something to do with me needing an .ignore
The file reads in 2002 then 032FADC032FB3C and goes on and on and on.
EDIT: Also when i view the .txt in notepad, it shows what looks like a space, then a tab between each piece of data, and what seems to be a space and two tabs between both ".9"'s
Is there a way i can attatch the .txt to this post so everyone can see what im referring to? I cannot seem to find one
Nevermind, even erasing the tabs and leaving a single space doesnt fix it.