Can you guys please advise if this is possible or an other way to accompish the following:
I have a text file with certain fields for example
Student Number Student Name Student Semester Average
KCH0001 Emile 66
KCH0002 Roan 70
KCH0003 Zvone 22
I want to create an object in a Class called Student that has 2 variables for a method called stdName and stdMark.
I read the new student numbers into a variable called stdNum and want to create an object with the current value of the variable of stdNum like follows:
Student "KCH0001" = new Student(); --> I know this doesn't compile I jsut want to show what I want to do.
So basically I want to create a new object every time the a new student is added to the text file?
As previously hinted, you are probably going about this backwards. To find whether the text file has changed, you would require a thread with an infinite loop which checks the file for its most recent update, then reads the file to count how many new lines it has. That is probably an inefficient way to program.
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad: