Unless the
word can be broken over two lines (using the - character to break), simply read each line one by one (using BufferedReader perhaps), then use indexOf. Unless you want a case insensitive search, then perhaps a java.util.regex.Pattern (declared outside the loop) with the Pattern.CASE_INSENSITIVE flag set and a Matcher inside the loop can be used. In pseudo code:
Now, if the word can be broken over two lines, that's going to be tricky; you'll require multiple lines in memory at the same time; at least two.