Searching a file for a String Occurence
Okay, I can't read anymore about file I/O.
I have the follow class:
Code:
class Student
{
private:
std::string studentName;
int numberDaysPresent;
int numberDaysAbsent;
int totalDaysOfClass;
double currentGrade;
}
I read the data in from a comma delimited text file, and create 543 Student objects that contain that data.
What I want to do now is search a different data file for all occurences of Student[x].studentName. But I do not want to load the other file completely in memory because it contains 11000 lines of data (and takes forever to load) in the following comma delimited format:
DATE OF CLASS, STUDENT NAME, CLASS PARTICIPATION GRADE, QUIZ GRADE.
I have been chewing on this one for several days, and haven't been able to figure it out. Any suggestions would be greatly appreciated.
Cheers!
EDIT:
I then want to grab just the data from the file that relates to the matched student and assign it to the following class:
Code:
class OldStudentData
{
std::string dateOfClass;
std::string studentName;
double participationGrade;
double quizGrade;
}