Two Laptop Bag*
The moose likes Java in General and the fly likes How to find the occurrences of names in a text document contains a paragraph Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to find the occurrences of names in a text document contains a paragraph" Watch "How to find the occurrences of names in a text document contains a paragraph" New topic
Author

How to find the occurrences of names in a text document contains a paragraph

Nagaraj Shivaklara
Ranch Hand

Joined: Dec 16, 2008
Posts: 77
Hi,

Can you please help me with this?

I have 2 files, 1. Words.txt (Contains some words) 2. Data.txt(Contains a paragraph); I need to find out and display for each word listed in Words.txt appeared in Data.txt.

Can you please help me with the logic??

Thanks
Nagaraj


Thanks n Regards,
Nagaraj S K
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3504
    
  14
Put all the words from data.txt into a Set. Check if each of the words in words.txt is in the Set.


Joanne
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to find the occurrences of names in a text document contains a paragraph