I am just learning that language and was wondering what a more experience Java programmer would do in the following situation?
I would like to create a java program
The java API does offer the java.util.Scannerclass which will allow you to scan across an input file.
Depending on how you intend to use this, however, this might not be the best idea. Is the file very large? Are you searching only one file or are you trying to keep a database of many files and search for files within that? In that case, you might want to use a more fleshed out engine such as lucene.