I have a text file in the following format:
Surname, Forename: Day.Month.Year: Degree
Sellen, Jo: 03.07.1986: MSc CSE
Parfitt, Harry: 20.03.1984: MSc IT
How can I write a shell script that uses awk to read the file (class.txt
) like this:
awk '{gsub(/ +/,"\t");print}' class.txt
and outputs the data in the following format, that exchanges the second and third column:
Surname Forename MSc stream Date of Birth
Sellen Jo MSc CSE 03.07.1986
Parfitt Harry MSc IT 20.03.1984
(Don't worry if tabbed columns don't line up)