Does somebody know about a program for giving us the number of occurrences of each word in a text file?
Well, this sounds like a good job for perl...
perl -e 'open F,$ARGV[0];for(<F>){for(split /\W/,$_){$t{lc $_}++}}for(sort keys %t){print $_, " => ", $t{$_}, "\n"}' forums.txt
Thanks to all who have tried to help me.
Michael: your perl program does not work very well with accented words. Please, apply it to the following text:
O primeiro-ministro iraquiano, Iyad Allaoui, deu uma última hipótese às milícias de Moqtada al Sadr para deporem as armas e abandonarem a mesquita do Iman Ali. Em Nadjaf, o ruído de tiros e explosões regressaram.
Paul
____________________________________________________ Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com ____________________________________________________