This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 3479
    
  13
Put all the words from data.txt into a Set. Check if each of the words in words.txt is in the Set.


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find the occurrences of names in a text document contains a paragraph