howard$: cat input.txt 77 * 10 0 * * 0 340 141 * 40 0 * * 0 240 howard$: perl -lane 'print "$F[2]\t$F[7]" if $F[7] > 0' < input.txt 10 340 40 240