I have HTML files. I am trying t o delete all lines of HTML between two tags,
<div class="printfooter">
.
.
multiple lines of HTML code
NOt all the same in each file
.
.
</body></html>
I want to delete the tag <div class="printfooter"> and everything that follows it except for the last two tags. I want to keep the last two tags on the pages: </body></html>
I had asked about this before and was using NewPP limit report as the starting point. <div class="printfooter"> is the better starting point.
The answer I got was this:
Simon Carter suggested I use the following:
Use the EasyPattern search replace:
NewPP limit report[ 0+ chars ]</script>[ 0+ whitespace ]</body>
Replace with:
</body>
If you have more than 4KB of text in-between, then click the [...] button next to the search/replace type and increase the maximum match size.
But this did not work. When I ran it,the output log said there was no difference between the input and output file.
deleting all lines of HTML code between two points
Moderator: DataMystic Support
deleting all lines of HTML code between two points
- Attachments
-
- 8-23-08- easypattern Filter.jpg (130.42 KiB) Viewed 10400 times
- DataMystic Support
- Site Admin
- Posts: 2287
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: deleting all lines of HTML code between two points
Get rid of the cr/lf after your <div> tag - it is preventing the pattern from matching.
Also, copy some text into the trial run area and test it out there with Prompt On Replace turned on.
Also, copy some text into the trial run area and test it out there with Prompt On Replace turned on.
Regards,
Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments
Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments
Re: deleting all lines of HTML code between two points
It still does not seem to work.
I have this for the find EasyPattern: <div class="printfooter">[0+chars]</body>
To be replaced by this: </body>
I made the max match size over 300000.
The output logs says that: 1) either that the output does not appear to be different to input file - deleting (output filter\output only modified files)
or 2) 0 replace(s) performed for pattern match [<div class="printfooter">[0+char]<body>\r\n\r\n]
I have attached the part of the html files that I am trying to eliminate: Everything between <div class="printfooter"> to the end. I want the printfooter eliminated and want to add back in the ending tags of body and html, if they are deleted.
Regards,
Bill
I have this for the find EasyPattern: <div class="printfooter">[0+chars]</body>
To be replaced by this: </body>
I made the max match size over 300000.
The output logs says that: 1) either that the output does not appear to be different to input file - deleting (output filter\output only modified files)
or 2) 0 replace(s) performed for pattern match [<div class="printfooter">[0+char]<body>\r\n\r\n]
I have attached the part of the html files that I am trying to eliminate: Everything between <div class="printfooter"> to the end. I want the printfooter eliminated and want to add back in the ending tags of body and html, if they are deleted.
Regards,
Bill
Re: deleting all lines of HTML code between two points
Problem Solved.
I have it working now. Maybe the difference is that in EasyPattern, I typed the pattern into the box rather than cut and pasted it.
On the HTML files, I want to delete everything between <div class="printfooter">[0+char]</body> and then replace it with </body>.
I checked the output and all code between <div class="printfooter"> and </body> is gone!!! Maybe by cutting and pasting, i was sticking in CR/LF's and not knowing it.
Thank you for your help.
Regards,
Bill Schaepe

On the HTML files, I want to delete everything between <div class="printfooter">[0+char]</body> and then replace it with </body>.
I checked the output and all code between <div class="printfooter"> and </body> is gone!!! Maybe by cutting and pasting, i was sticking in CR/LF's and not knowing it.
Thank you for your help.
Regards,
Bill Schaepe
- DataMystic Support
- Site Admin
- Posts: 2287
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: deleting all lines of HTML code between two points
You were - you can see in your log below that your search/replace had 2 extra lines after it
Glad it's working now!2) 0 replace(s) performed for pattern match [<div class="printfooter">[0+char]<body>\r\n\r\n]
Regards,
Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments
Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments