Currently reading in a file with about 42,000 records in it. Although my vectors seem to always come up with 21,000. Going through debugging it seems to be skipping duplicate values. Like in the data example, there are 3 59's in column three. The run through input only has one then goes to 58.
Data Example:
20070906_NO@IND 1 59 55 IND NO 1 10 68
20070906_NO@IND 1 59 49 IND NO 2 10 68
20070906_NO@IND 1 59 15 IND NO 3 3 61
20070906_NO@IND 1 58 55 IND NO 3 8 66
20070906_NO@IND 1 58 49 IND NO 4 8 66
{
ifstream infile;
infile.open ("2007.csv");
while (infile.fail())
{
cout << "Invalid File Name, Please Try Again. /n Filename: ";
cin >> FileName;
infile.open(FileName);
}
while(!infile.eof())
{
while (getline(infile,STRING, '\n'))
{
infile.ignore(',', ',');
getline(infile,tempQuarter, ',');
getline(infile,tempMinuteRemaining, ',');
infile.ignore(',', ',');
getline(infile,tempOffenseName, ',');
getline(infile,tempDefenseName, ',');
getline(infile,tempDown, ',');
getline(infile,tempYardToGo, ',');
getline(infile,tempNextYardLocation, ',');
//Assign data to Vectors
AssignToVector(tempQuarter,tempMinuteRemaining,tempOffenseName, tempDefenseName, tempDown, tempYardToGo, tempNextYardLocation, tempPlayDescription);
}
}
cout << "Reading Completed"<<endl;
infile.close();
}