File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nagaraj Shivaklara
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joanne Neal
Rancher
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put all the words from data.txt into a Set. Check if each of the words in words.txt is in the Set.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic