perl -lane'print "$F[0] $F[-1]"' data.txt # prints the first and the last fields of a space delimited record
CSV example:
perl -F, -lane'print "$F[0] $F[-1]"' data.csv