Quote:
Originally Posted by weevil
Code:
sort -u file-a > file-b
to sort and store all the unique words in file-a to file-b, then
to get the number of words
Stuff like this is where the command-line shines, no need to mess around with writing a program or complicated script!
|
Using a Python dictionary was the first thought I had reading the OP, but after seeing he somehow didn't care about the frequency, the -u unique flag is clearly the simplest way to do it.