use strict; open (IN,"<in.txt") or die $!; while (<IN>) { print "$1\n" if (/^\s*((?:[^\s]+\s+){4})/); } close(IN); [download]
In reply to Re: Counting words by jbware in thread Counting words by Anonymous Monk