perl -wle 'while(<>) { $count++ if "rrr" eq join "",(split)[1 .. 3] }; print $count' my_column_file.txt 3