I'm trying to write a function that takes a keyword and searches through a list of files then prints out any of the files that contain the key word.
So far all I have is a list of files and the keyword.
File[] files = new File("<directory>").listFiles();
Scanner keyword = new Scanner("hello");
I think now I need to construct some form of loop that goes through the files looking for the keyword. Any help of even an easy to follow tutorial is appreciated.
edit:
The files are text files that only consist of one line