Results 1 to 3 of 3
Thread: Text file over written
- 11-10-2007, 08:39 PM #1
Senior Member
- Join Date
- Nov 2007
- Posts
- 111
- Rep Power
- 0
Text file over written
I am trying to learn file handling in Java. I want to append text to the end of a file and tried following script:
But the text file is overwritten. I know I can use RandomAccessFile to point to end of file and then append. Is this possible with BufferedWriter?Java Code:BufferedWriter out = new BufferedWriter(new FileWriter("C:\\myFile.txt")); out.write("aString"); out.close();
- 11-11-2007, 03:08 AM #2
The FileWriter class api shows a couple of constructors that take a boolean append argument. You can find out what they do in the Constructor Detail section.
- 11-11-2007, 07:32 PM #3
Senior Member
- Join Date
- Nov 2007
- Posts
- 111
- Rep Power
- 0
Similar Threads
-
count character in text file as input file
By aNNuur in forum New To JavaReplies: 7Last Post: 03-25-2010, 04:01 PM -
Search in text file
By mark-mlt in forum New To JavaReplies: 6Last Post: 04-03-2009, 04:33 PM -
How to read a text file from a Java Archive File
By Java Tip in forum Java TipReplies: 0Last Post: 02-08-2008, 09:13 AM -
Reading text file
By Lennon-Guru in forum New To JavaReplies: 1Last Post: 12-15-2007, 11:38 PM -
Converting text file(.txt) to JPG file(.jpg) in java
By javadeveloper in forum Advanced JavaReplies: 0Last Post: 11-09-2007, 04:22 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks