Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Fast way to count words in a text file

721850Dec 25 2006 — edited Dec 26 2006
Hi!
Like the subject says, I'm looking for a really fast way to just count the words in a text file. Right now I simply use a buffered reader and increase the count by 1 with each reader.next() statement. It works, but if the text file is 1MB+, it takes quite some time. Is there a quicker way to do this?
Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 23 2007
Added on Dec 25 2006
13 comments
1,098 views