• Post Reply Bookmark Topic Watch Topic
  • New Topic

Delete from file

 
Tha�s Manfrim Firmino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�d like to know the best way to delete some content from a file. Please help me!
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would depend on the type of file.
 
Tha�s Manfrim Firmino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It�s an text file. I tried to use the class Properties, but I can�t use it because only some lines use the sign "=" and this class rewrites the file so that it will have "=" in every single line.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably a bad idea to use Properties if you expect the output to be a format different from what Properties uses.
Check out the Java Tutorial section on IO: Reading and Writing. If you are working with text, you will probably want to use FileReader/BufferedReader and FileWriter/BufferedWriter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!