What is the best way to find the total number of words in a text file in Java? I\'m thinking Perl is the best on finding things such as this. If this is true then calling a
If you are on a unix, wc -w filename will do the trick.
wc -w filename