As the subject goes, what's the optimum way to open a text file with multiple, varying length lines for processing. Basically the lines in the file have values that are tab-delimited and I want to read the values in and assign them to different fields on a HTML form. Thanks.
Look through the JavaDoc for FileReader and BufferedReader to read a file one line at a time. Look at String.split (JDK 1.4+) or StringTokenizer to break up the tab delimited fields. If you're feeling adventurous and you know some RegEx, look at Scanner (JDK 5+) to do both at once. Let us know how it goes!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Actually if you're using JDK 5, Scanner is a good choice even if you don't know regex (yet). You can just create one and use the nextLine() method to read lines, much like you would use readLine() in a BufferedReader. But Scanner gives you a lot more options than BufferedReader does.