Looks like a shell script homework assignment to me. Plenty of examples on how to read a file on this forum. Look around and you'll find something fairly close. Remember, in Unix the answer is always yes. The question is how?
I would consider thepubba's advice as well as checking out google. The book below "Unix Shell Programming" by Kochan & Wood teaches shell programming by using a complete rolodex example: