• Post Reply Bookmark Topic Watch Topic
  • New Topic

Appending

 
Mary Connolly
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to append text to the end of a text file? Apart from reading in a file and then writing it out again + writing out new information.
thanks
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use a java.io.FileWriter, then you can use its FileWriter(String fileName, boolean append) constructor to create an instance of the writer that will append.
For example:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!