943,696 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 6932
  • Java RSS
Jan 17th, 2004
0

StringTokenizer

Expand Post »
HI I have written a program that reads text from the input file and writes the text to the out put file. Im using the StringTokenizer to count the number of words in the input text file. The problem is that it reads only the first line but it does not read the second line of text. How do I instruct the StringTokenizer class to jump to the second line?

I have tried the following:

buf = dinn.readLine();
reader = new StringTokenizer(buf,"\n");

As you can see I added a delimiter \n but no success. I have attached the whole program that I wrote, but please do not distribute. Thanks
Attached Files
File Type: zip a - Read File - program.zip (20.1 KB, 52 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Turbo is offline Offline
2 posts
since Jan 2004
Jan 17th, 2004
0

Re: StringTokenizer

ACTUALLY I HAVE FIGURED IT OUT... SO NO MORE HELP IS NEEDED.. If anyone wants to see it how I did it then take a look at the latest program... I had to make some modifications so no longer the user is prompted is he/she wants to save the results to the file... it is done automatically... in the second version of this program I will make that addition. Thanks
Attached Files
File Type: zip a - Read File - programUpdate.zip (13.9 KB, 91 views)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Turbo is offline Offline
2 posts
since Jan 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: DLL equivalent to xerces.jar
Next Thread in Java Forum Timeline: Java with String Tokenizer





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC