Reading ints from text file to an array

This is a discussion on Reading ints from text file to an array within the C Programming forums, part of the General Programming Boards category; I can't seem to figure out how to read from a text file and to fill an array.
For example, ...

Reading ints from text file to an array

I can't seem to figure out how to read from a text file and to fill an array.
For example, lets say that my text file looks something like this:1234P
100 100 100 100 100 100 100 100 100
100 100
100
15
2381
P
100 100 100 100 100 100 100 100 100
100 100
100
15
3452
N
100 100 100 100 100 100 100 100 100
100 100
100
15
.
.
.
.
.
etc.
The first number is the student ID, followed by a Pass/No Pass on class assignments, 9 homework scores, 2 midterm scores, the final, and extra credit. I have 11 ID's and grades in the file. I'm supposed to scan the ID's and put them into an array. Then scan the grades (the algorithm is determined by adding up the average of each and making sure that the student meets basic requirement, ie homework must be over 80%, midterms over 60, etc)

How the HECK do I go about doing this? I've been trying many methods of code and NOTHING seems to work for me. Its depressing. I did manage to open the file successfully... haha.
How would I link which score is to which ID? How do I go about scanning in each line? I CANT EVEN SCAN IN THE ID's into the array for Pete's sake. Yes, I'm getting a little hysterical. Sorry. Anyway, I do have code written up, some is commented out since I've been trying so many approaches. But frankly, it looks like codevomit. But if it would really make a huge difference, let me know and I'll post it up.

Thank you for your time! I know this is a lot to read, but I'm desperate to get this program to work!

Hi,
If your text file format is same, then, you can read the first line of text file for ID and store it in an array. The next ID will be at 7th line. So, you have to read 7th line i.e., ignore 6 lines in between and store the value at 7th line in the array repeat this for grades also

Like I said, its a mess. Sorry about that. Some things are commented out because I was trying different methods. Sandeep1508, I did try ignoring the 6 lines, I did i+=6, i+6, but nothing works. I end up printing out trash when I try to print the array that the ID's are supposed to be stored in.