perl -ne '$n=tr/://;$h{$n}++; END{ print "$h{$_} lines have $_ colons\n" for(sort{$a<=>$b} keys %h)}' < gleandata.csv #### my @row = split(/:/, $line, 24);