I want to rewrite text in all of php files, they all contain a line of text on the 4th line that I want to remove but since there so many I don't want to manually go through each and every one. So in short, I want to rewrite line 4 of all my .php ending files and replace line 4 with a simple " " space or something. Thanks in advance!
1. Download Textpad (try before you buy) (or some other decent text editor). 2. Open all your files. 3. Do a global search and replace. (If you need help with a Regular expression to do this, post here.) 4. Save all files.
Well the thing is, I need to use rewrite to do this, there's a copyright on the top of this script I have and it's impossible to remove (it's encripted in base64) but when it's in html, it always ends up on line 4, how can I rewrite line 4? thanks!
I would use sed for this. This command will remove the 4th line and output the file: sed 4d filename.txt You can redirect the output or use the -i switch to edit it in place (make a backup copy first). Use the for command to process all your files. J.D.
Sounds to me like you want to do this after the PHP has already processed - since the existing script is generating the text, you want to remove it afterwards. This is a little more difficult of a prospect. I wouldn't know how to get that done, but it sounds like maybe it shouldn't be done anyways.