[Logo]
Forums Register Login
write .txt file
Hi All,
I have an string like "one,two,three, four,five,six".
and am sending different strings like above one by one.
I wanna write each word in separate line and save it as .txt file.
the text file has to be
one
two
three
four
five
six
2nd string
seven
eight
nine
.
..

Please help me out.
Thanks
Jowsaki
[ February 06, 2003: Message edited by: Sham Jowsaki ]
Hi Sham,
All you need is a BufferedWriter and a StringTokenizer and you're in business.
Try this:

After you compile and run this, just open up the file out.txt in the same directory and see if it meets your criteria.
Hope this helps,
Michael Morris
[ February 06, 2003: Message edited by: Michael Morris ]
 

Originally posted by Michael Morris:
Hi Sham,
All you need is a BufferedWriter and a StringTokenizer and you're in business.
Try this:

After you compile and run this, just open up the file out.txt in the same directory and see if it meets your criteria.
Hope this helps,
Michael Morris
[ February 06, 2003: Message edited by: Michael Morris ]



Thanks Michael. It is working fine.
Jowsaki

This thread has been viewed 766 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 14, 2018 14:12:46.