Jump to content

Remove stuff from a txt file


cowuser

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/4418-remove-stuff-from-a-txt-file/
Share on other sites

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.
[!--quoteo(post=353046:date=Mar 9 2006, 12:38 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 9 2006, 12:38 AM) [snapback]353046[/snapback][/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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.