Hi! I am trying to create a simple administration system that takes in info from two files, AdminNum.txt and data.txt
AdminNum.txt, which has the student's administration number as shown:
123456
123457
123458
123459
|
data.txt, which has the student's administration number, first name, last name and their grade
123456 Nelson Cape A
123457 Lance Varnes A
123458 Darren Aguinaldo C
123459 Noreen Rierson B
|
I have managed to firstly prompt the user to enter their admin number, and then checks if the admin number matches any on AdminNum.txt. If it matches, their admin number will be stored in a string variable called StoredNum and they may enter a menu where they have the option to view their grades etc.
My question is, how can I retrieve the user's info from data.txt? Is there a way I can sort of compare the StoredNum with the first 6 characters in each line of data.txt and if it matches, the line will be extracted into a temp variable, which then I would be able to output their name and grade. If it helps, the data on each line of AdminNum.txt and data.txt will be for the same user.
Thanks for the help! :)