Quick overview of the code. The first line is skipped by the first call to readLine(). Each line read is appended to a StringBuffer with a tab placed after each line. The tab is needed because when the Strings are appended to the StringBuffer no spaces will be added. Then the StringBuffer is cut into tokens which are blank spaces or tabs.
Code:
import java.io.*;
import java.util.*;
public class Example121{
public static void main(String[] args){
try{
File f = new File("C:" + File.separator + "Java" + File.separator + "Test.txt");
BufferedReader buff = new BufferedReader(new FileReader(f));
String firstline = buff.readLine();
StringBuffer sb = new StringBuffer();
while(true){
String s = buff.readLine();
if(s == null) break;
sb.append(s);
sb.append('\t');
}
StringTokenizer st = new StringTokenizer(sb.toString());
while(st.hasMoreTokens()){
System.out.println(st.nextToken());
}
}catch(IOException e){;}
}
}