StringTokernizer Problem
Hi guy
I am new to java and trying to write a simple program. I am trying to read all the contents from a file and break them in words. I donno why I am just gettin FIRST word when i run the following program.
Basically I just has 1 line in my text file, which is this
(this is the conformation number of the payment which we made => 049071 .)
when i run my program I just see "this" instead of all the words.
WHY?
Can anybody tell me what's wrong i am doin!
Thank alot in advance
try
{
BufferedReader br =new BufferedReader(new FileReader("C:/Documents and Settings/Adeel/Desktop/bell.txt"));
String read = br.readLine();
StringTokenizer stk =new StringTokenizer(read," ");
while(stk.hasMoreTokens())
{
//System.out.println("Test 1");
String result = stk.nextToken();
//System.out.println("Test 2");
//System.out.println("file:" + result);
int i = Integer.parseInt(result);
System.out.println("file starts. "+i);
}
}catch(Exception e)
{
System.out.println(e.getMessage());
}

