My question is I have a txt file with several lines of info which include first name lastname hourly rate (since its a payroll program.) they are comma seperated. So i have use JoptionPane and read individual line and ask user how many hours first person worked. After input it goes thru the whole file (loop) asking how many hours each person worked. so far i have done that , i used strinktokenizer to read file line and comma delimited. but i cannot display it
My current code is. while((rec=fileIn.readLine())!=null) { tok = new StringTokenizer(rec, ", ")
That is the code with some gaps... big ones. Hopw about changing: ``` tok = new StringTokenizer(rec, ", ") ``` to ``` StringTokenizer tok = new StringTokenizer(rec, ", ") ``` And here are a few sites with examples of use: http://www.mkyong.com/java/java-stringtokenizer-example/ http://www.java-tips.org/java-se-tips/java.util/how-to-use-stringtokenizer.html
thanks. I solved the program.!!
Join our real-time social learning platform and learn together with your friends!