Re: Some Help Please

Erik Sigra <[email protected]> Sat, 07 Oct 2000 01:13:15 +0200
Newsgroups gmane.games.freeciv.java
Message-ID <[email protected]>
Houjeh Tiourchi wrote:
> 
> The following code reads a text file, makes a tally of all the different
> words used in the file, and prints out a list of the words that appear
> most frequently, along with the number of times each word appears.
> Please explain to me what each lone of code does and how if possible. I
> am a novice and really want to learn this piece of code inside and out.

Why use a long java program? I just used a unix command to do it.
Something like:

cat foo.bar | tr "[A-ZÅÄÖ]" "[a-zåäö]" | tr -d "\(\)\_\t" | tr "
0123456789\"\-\.\,\:\;\'\=\<\>\?\!\/\*\[\]" "\n" | sort | uniq -c | sort