954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

StringTokenizer

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

Attachments a_-_Read_File_-_program.zip (20.06KB)
Turbo
Newbie Poster
2 posts since Jan 2004
Reputation Points: 10
Solved Threads: 0
 

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

Attachments a_-_Read_File_-_programUpdate.zip (13.94KB)
Turbo
Newbie Poster
2 posts since Jan 2004
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You