[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
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 25, 2017 01:00:20.