Read the complete file into some structure which is equivalent to the data in the file and then either arrange them in a Linked List or even array and then traversing through it would help you get the needed record.

The above solution would work assume you have few records and not thousands of them or else you may run out of memory