Stimulated by Marco, and by this post, I wanted to add my personal contribution…
Instead of jumping on the winner’s bandwagon like Marco, I opted for Perl, a language (once) de rigueur for problems like this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
my $numlines = $ARGV[0] or die "Missing parameter\n";
my %wcount;
while (<STDIN>) {
tr/A-Z/a-z/;
for my $s (split /[^a-z0-9]+/) {
next unless $s;
$wcount{$s}++;
}
}
for my $w (sort { $wcount{$b} <=> $wcount{$a} } sort keys %wcount) {
print $wcount{$w}, " $w\n";
last unless --$numlines;
} |

![Validate my Atom 1.0 feed [Valid Atom 1.0]](/images/valid-atom.png)

