Count same word from many file in directory
Hi! i'm beginner in java programming. i need count same word from many files, example:
doc1 : boys like to play football
doc2 : girls play tennis
doc3 : almost all boys and girls play tennis
lets say my program read doc1 and first word is "boys", now my program will check if "boys" is also appeared in another document, if appeared, count the word "boys". And it will check second word "like" is also appeared in another document or not, if not appeared, remove that word. And i need output is the filename and the word that appeared in another document.
Any code or example? please, i really need code example.
thank's for your answer and sorry for my bad english.