You seem to have a scope issue. It seems like some code got spliced between lines 121 and 131, resulting in a compilation error.
After patching the issue, you'd still have a problem as reading wouldn't stop until i (which, another scope issue, only exists in your for loop) reached 100, even if there were less than 100 words to read in your file.
Moving filewords out of the loop would be a start.
As for stopping reading at the right time and the variable shadowing problem (i being redeclared in a narrower scope)... think about what the while loop on 119 does. Do you need that inner for loop?