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

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