How would I write a loop so that it would use a tokenizer to read each individual string from a line in a text file? I want it to be able to return each induvidual word to test it for a certain condition, and then break out of the loop when the line is finished.
posted 12 years ago
One of the nice features of the JavaRanch forums is that they can be searched. And believe me, many of those past conversations are full of good information. (This obviously excludes all chatter in MO and MD.) I just did a quick search on FileReader and stumbled across an old thread in which Corey McGlone posted the example code I've often seen and used to read in a text file line-by-line. I'd bet you'll be able to modify his example to do the processing (and breaking) as you want it.