i have a file "*.txt" that contains a lot of informations seperated by ";"
i wanted just to read the second and the third argument.can you please help me doing that?
this is my code that allows me to read text file
how can i read only the 2nd and the third argument from this file??
krishna kanth wrote:You can use StringTokenizer...
You can, but I'd suggest you don't. StringTokenizer is a legacy class, which has been superceded by Scanner (java.util.Scanner).
However, you don't even need that. You already have what looks like perfectly good code for processing lines, so just do what Maneesh suggested for each line (even bigger hint than he gave: look at String.split() ).
Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here