• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to delete the content of a file  RSS feed

 
pradipta kumar rout
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Respected Sir,
I want to delete the previous contents of a file ...
and start to write new strings to the fiel is there any method to doing this .
kindly suggest me .....


please help me...

Thank you
Pradipta Kumar Rout
 
Siddhesh Deodhar
Ranch Hand
Posts: 118
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check usage of FileOutputStream.
 
Anupam Jain
Ranch Hand
Posts: 61
Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also want to check usage of FileWriter

This would be better useful when you need to take some decisions while writing to the file.
 
prem pillai
Ranch Hand
Posts: 87
Java Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In java.nio.channels.FileChannel .... try to find methods for truncating the file content ..
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pradipta kumar rout wrote: . . . I want to delete the previous contents of a file ...
and start to write new strings to the fiel is there any method to doing this . . . .
That is really easy; you already have some useful suggestions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!