Reading data from a text file to an array

Student marks are kept in a text file as a single column.

Each student may have a different number of assessments and therefore scores.

The data recorded in the file for each student start with the number of scores for the student.

This is followed by the student id and then several marks student scored in various assessments, one per line.
A small segment of the file might look like the following,,,,

2
S1234567
55
70
4
S2222222
96
67
88
88

So, according data presented in this file, the first student has 2 scores, student id is S1234567, and the assessment scores are 55 and 70. The second students has 4 scores, student id is S2222222, and the assessment scores are96, 67, 88 and 88.

I need help with storing these values in an array.
(I have no idea where to begin!!!)
closed account (48T7M4Gy)
(I have no idea where to begin!!!)

Textbooks, lecture notes, courses ... tutorials.
Topic archived. No new replies allowed.