Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Delete text when using RandomAccessFile  RSS feed

 
Panihari Mehta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!