Suppose I have a dataset with names and registers like
John Wayne 1234
Paul Newman 2345 Wrong register. The correct register is 2233
John Fitzgerald Kennedy 3456
Marilyn Monroe 1212
All lines are space separated. I want one (or two) regular expressions to use in awk that give me the following outputs:
John Wayne
Paul Newman
John Fitzgerald Kennedy
Marilyn Monroe
and
1234
2233
3456
1212
I know the data is in a very, very bad formatting, but does anyone know how to help me?