John,
If you are on
Java 5 (and this isn't a school project), you can use the Scanner class. If not, you'll have to read the lines of the file yourself. Either way, you need to figure out how to express what you want to match in Java.
If you share which approach you plan to take (scanner vs read file), you may get some more concrete advice.