Just read the file into whatever data structure seems easiest to you - a linked list of structures if you like, or a couple of static arrays if you're allowed to specify an upper limit of lines in the input file (no point complicating things unnecessarily).
Then run your favourite sort algorithm on the grade, remembering also to swap the entries in the name part of the data structure.

How far have you got with the project? Can you at least read the file into a data structure of your own design?