how to delete lines of a file in java?

Thread Solved

Join Date: Mar 2006
Posts: 8
Reputation: qinise4 is an unknown quantity at this point 
Solved Threads: 1
qinise4 qinise4 is offline Offline
Newbie Poster

how to delete lines of a file in java?

 
0
  #1
Oct 15th, 2007
I am currently trying to delete lines of a file in java?
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,387
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 254
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: how to delete lines of a file in java?

 
0
  #2
Oct 15th, 2007
Read the file, writing it to a new file at the same time, and omit what should be deleted. Then rename the old file to a different name. rename the new file to the old name, then, if all of that is successful, delete the old file.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC