Number for Fields in AWK

awk ‘{print $(NF-1)}’ infile

 

NF is a built in variable for the number of fields in

each line, so this means print what is held in the

last field (minus 1)