Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write in to .txt like given format  RSS feed

 
Nagaseshagiri poola
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i want to write data in to text file like this format
Number!Name!value!time
Number1!Name1!value1!time1
...
...
i used fos = new FileOutputStream(filePath, true) and
method used to print is fos.write((MyLine).getBytes());
its is printed as
Number!Name!value!time Number1!Name1!value1!time1 ......
please help me...
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you just need to tack a newline on the end of each line you write.

or use a print writer of some kind that has writeln() method:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!