To delete records from a file you must first present the record to the user to make sure that this is the correct record to delete. When this is confirmed you can then proceed to delete the record from the file.
To delete a record we need to be able to do the following tasks:
Search for the record.
Display the record.
Update the file.
To search for a record we will use the field surname. Once we have got a surname from the user on which to search we can then proceed. We could use grep or awk, but because our file will have no more than perhaps 100 records we shall read the file in and test for a match.
If your file is going to contain over a couple of hundred records, I advise you to ...