Dear friend it is days that i couldnt find any solution for my problem.
I use:

while ((line = reader.readLine()) != null){
	    StringTokenizer tokens = new StringTokenizer(line," ");
	    System.out.println(tokens.nextToken());
	}

this loop for reding all inputs of file but this loop only shows the irst token of the file and even i dont know how to make it to read the second,third... lines in the input file..

Thanks.

Recommended Answers

All 2 Replies

Another loop inside that one on

while( tokens.hasMoreTokens() )

is all you need.

Thank you Ezzaral, it helped me..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.