Skip to Main Content

New to Java

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!

Search word in text file

969679Oct 20 2012 — edited Oct 31 2012
Hello,
someone can help me with code?
How to search in text file any word and count how many it were repeated?

For example test.txt:
hi
hola
hey
hi
bye
hoola
hi
And if I want to know how many times are repeated in test.txt word "Hi" program must say "3 times repeated"

I hope you understood what I want, thank you for answers.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2012
Added on Oct 20 2012
17 comments
714 views