aspose file tools*
The moose likes Beginning Java and the fly likes Delete text when using RandomAccessFile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Delete text when using RandomAccessFile" Watch "Delete text when using RandomAccessFile" New topic
Author

Delete text when using RandomAccessFile

Panihari Mehta
Greenhorn

Joined: Jun 10, 2002
Posts: 1
Dear Ranchers,
Is there any way to delete text in the middle of a file using RandomAccessFile ? I am making the end user modify the contents of a Properties file and then append the modifed contents to the end of the file.
Here i wish to delete the original contents before i append the modified content to the end of the file.
Any ideas,pls suggest,
Thanks in advance,
Regards,
Panihari :roll:
Andrew Spruce
Greenhorn

Joined: Feb 27, 2001
Posts: 21
Were you aware that there is a Properties class in the standard libraries with correspoding load() and store() methods to write to and read from an OutputStream/InputStream.
This would probably be cleaner than trying it yourself
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Delete text when using RandomAccessFile
 
Similar Threads
why use RandomAccessFile
JQ+ question RandomAccessFile help.....
problem with random access file
file i/o question
Best Way to Write an Array To A File