perl -lane '$count++ if "rrr" eq join "",@F[1 .. 3] }{ print $count' my_column_file.txt