Assuming a file exists, test.txt, with the following contents:
10 Peter Terence Roux 45 11 Virginia Genevieve Roux 45 12 Felix Devon Roux 5 13 David Bruce Stevenson 48 14 Bob James Smith 16 48 Adam Winter Ridley 23
To set an alternative field delimiter:
awk '{FS=":"}{print $2,$4}' test.txt
or
awk -F: '{print $2,$4}' test.txt
NOTE: This is useful when a space is not being used as the delimiter in the input file.
To set an alternative field delimiter for the output:
awk '{OFS="-"}{print $2,$4}' test.txt
returns:
Peter-Roux Virginia-Roux Felix-Roux David-Stevenson Bob-Smith Adam-Ridley
NOTE: The OFS variable is used to specify the output delimiter.