perl -F, -ane '$arg||=pop; ++$cnt if $F[7] eq $arg }{ print "There are $cnt $arg s\n"' filename.txt string