I have a files students.txt, with lines of the form:
Surname, Forename: Day.Month.Year: Degree
For example:
Smith, John: 15.01.1986: MSc IT
Taylor, Susan: 04.05.1987: MSc IT
Thomas, Steve: 19.04.1986: MSc MIT
Sellen, Jo: 03.07.1987: MSc CSE
How can I change the command below into a sed command to return all the surnames of students who were born in 1987?
$ grep 1987 students.txt | grep -o "^\(.*\),"