Winston Posted August 29, 2004 Share Posted August 29, 2004 As the thread title says it all, how is this done? Link to comment Share on other sites More sharing options...
0 kibkid Posted August 30, 2004 Share Posted August 30, 2004 Do you want to append the text to the existing file? Or just write to it modifying it everytime? Link to comment Share on other sites More sharing options...
0 Winston Posted August 30, 2004 Author Share Posted August 30, 2004 i want to append text to the existing file. Link to comment Share on other sites More sharing options...
0 ItchyAnus Posted August 30, 2004 Share Posted August 30, 2004 Look at the java API docs (http://java.sun.com/j2se/1.4.2/docs/api/index.html) for FileWriter. Create a new FileWriter using the FileWriter(File file, boolean append) or FileWriter(String fileName, boolean append) constructors. If append is true, the text will be appended to the file: FileWriter f = new FileWriter("c:\\my_file", true); f.write("some text" + "\n"); f.close() Link to comment Share on other sites More sharing options...
0 Winston Posted August 30, 2004 Author Share Posted August 30, 2004 haha easy, thanks. Link to comment Share on other sites More sharing options...
Question
Winston
As the thread title says it all, how is this done?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts