with a given text of:
Daily, John
10.0 9.5 8.0 10.0
9.5 10.0 9.0
85.0 92.0 81.0
I am given this information on an imported .txt file and need to open and read the file and then write and save a new text file, which i know how to do, where I am stuck on is how i would manipulate each line of the read text separately, as the first line (the name) needs to be saved, but second line needs to be calculated into a quiz average amount and then the 3rd line a homework average and the fourth line an exam average and then all of them weighted separately and saved next to the saved name of the student.
note: after the fourth line starts a new student with the same information.
edit: i guess the simplest way to do this would be to have a for loop that read 4 lines of text at a time and worked each of those lines seperately then read another four lines. Is there any way to read in sets of lines instead of one line at a time?