Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing a newline char into a text file

 
samuel higgins
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using the FileWriter class, how to you write a newline into a text file? I tried \n but in the text file i just get a little black box.
thanks.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wrap the FileWriter in a BufferedWriter and use the newLine() method. Something like this:

[ April 21, 2003: Message edited by: Michael Morris ]
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi samuel
I have another method/suggestion to reference

I hope that I can answer your question
if you want to append the text to the text file
please post a message again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic