Hi, I wanted to find out if there is a way to write some text to a text file using FileWriter, close the writer, then open it up again later and append the text on the next line. Is there some way to return the cursor to the next line after writing so that the following line of text is on the line below the previous text? I'm using the following code:
Look at the FileWriter doc for another constructor ... I predict you will be pleased.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I did find the additional field for the constructor to append text. However, I did not see a method that will create a new line. I was wondering if anyone knew of any tricks that could be used to go to a new line.
I figured it out, I needed to add a BufferedWriter because the FileWriter doesn't have a method to create a new line, but the BufferedWriter DOES. I added the appropriate configuration and it works great! Hope this helps out anyone who has had the same issue.
This parrot is no more. It has ceased to be. Now it's a tiny ad:
Gift giving made easy with the permaculture playing cards