僅列印某些欄位

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

CSV 示例:

perl -F, -lane'print "$F[0] $F[-1]"' data.csv