Jump to content


Photo

Remove stuff from a txt file


  • Please log in to reply
2 replies to this topic

#1 cowuser

cowuser
  • Members
  • Pip
  • Newbie
  • 3 posts
  • LocationAthens

Posted 08 March 2006 - 10:55 AM

In some posts before i fould out how i can add stuff inside a text file in a specific place... the thing is i now want to find a way to erase specific things from that file. i have put in special tags to everything i have put inside ( like # 120 is here and # 120 ends here ). I need a way to erase the lines with these comments and the lines between them.

Also is there a way i can erase only one line of these? let's say the line that says allow 120 ? i know what that line says.

#2 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 08 March 2006 - 10:38 PM

Well you don't need comments or anything on the lines to be able to erase only certain lines, but my question is do you want to keep the line in the file blank or remove it completely? I have the solution for your problem, I think, but the code will be slightly different depending on your desired effect.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#3 cowuser

cowuser
  • Members
  • Pip
  • Newbie
  • 3 posts
  • LocationAthens

Posted 08 March 2006 - 11:42 PM

[!--quoteo(post=353046:date=Mar 9 2006, 12:38 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 9 2006, 12:38 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Well you don't need comments or anything on the lines to be able to erase only certain lines, but my question is do you want to keep the line in the file blank or remove it completely? I have the solution for your problem, I think, but the code will be slightly different depending on your desired effect.
[/quote]

Well remove it completely. it's better because i don't want the file to grow very large with junk




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users