in reply to How to capture a column from a set of lines

$ awk '{print $1 " " $5}' < foo | sort -k 2