File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing a newline char into a text file

 
samuel higgins
Greenhorn
Posts: 1
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic