im reading lines from a text file just fine.. what i need to do is seperate the line like so: text.txt: --------- 100 500 1000 200 450 2000 300 475 7503 ------------------------- when i read line 1 i get: "100 500 1000" i've tried multiple things, but can't get it to split the file up: var1 = 100 var2 = 500 var3 = 1000 can someone help me out with this.. or point me in the right direction?
thanks -- EG [ November 19, 2003: Message edited by: Eric Giblock ]
Look at the StringTokenizer class. You'll probably also need to look at the Integer class for the appropiate methods to parse the tokenized string into numeric values. Good luck. When you get some code worked out, post some more questions.
Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
In this case (in any case for that matter) the split method from the String class will make your life easier:
I have not tested this code and for your purposes (if you'd like to compile the code) you'll have to handle (or catch) the NumberFormatException if parseInt throws a temper.
Normal is in the eye of the beholder
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.