Batch deletion of html

  • biftek
  • Born
  • Born
  • biftek
  • Posts: 4

Post 3+ Months Ago

does anyone know of any progs that will delete garbish between to points
the points aren't html just pointers ,
<!---garbish--->
blah blah
<!----garbish--->
the "blah blah" changes from page to page , so does anyone know of a prog where i can set the 2 points (<!----garbish--->) and hit go and it'll delete all that lays between from all the pages

thanks in advance
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • philgill
  • Novice
  • Novice
  • User avatar
  • Posts: 24

Post 3+ Months Ago

Hi,
maybe you could be a little more specific in what your asking for!
What is Grabish anyway!!
phil
  • veedee
  • Graduate
  • Graduate
  • User avatar
  • Posts: 110

Post 3+ Months Ago

Maybe you can do with Advanced find & Replace(the newest is supported with regular expression), but I'm not realy sure 'cos I can't exactly understand regular expression, You better try download the shareware.
One more thing.. is your computer infected by HTML RedLof? Cos HTML RedLof act just like that.
-----
Sorry about My English
  • biftek
  • Born
  • Born
  • biftek
  • Posts: 4

Post 3+ Months Ago

philgill wrote:
Hi,
maybe you could be a little more specific in what your asking for!
What is Grabish anyway!!
phil


it was just an example of what i am wanting to delete between , as i said , they are just webdesigner pointers and play no part in the page , but what lays between them which is html is what i am wanting to delete

i have alot of pages that i am wanting to clean up , so instead of doing it bt hand , i was hoping someone could come up with a prog that will do it for me
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Using PHP with regular expressions you are looking at the following function:
PHP Code: [ Select ]
 
function stripGarbish($input){
 
    $startPoint = "<!--garbish-->";
 
    $endPoint = "<!--garbish-->";
 
    $regex="/" . $startPoint.".+?" . $endPoint . "/is";
 
    return preg_replace($regex,"",$input);
 
}
 
 
  1.  
  2. function stripGarbish($input){
  3.  
  4.     $startPoint = "<!--garbish-->";
  5.  
  6.     $endPoint = "<!--garbish-->";
  7.  
  8.     $regex="/" . $startPoint.".+?" . $endPoint . "/is";
  9.  
  10.     return preg_replace($regex,"",$input);
  11.  
  12. }
  13.  
  14.  


So open a file, feed the file contents to the function and it returns the file contents without anything that lies between the start and end points. It will also strip out the start and end points.

What is garbish???
  • biftek
  • Born
  • Born
  • biftek
  • Posts: 4

Post 3+ Months Ago

"garbish" is just a pointer , you know letting me know what the next section of coding is controling
its just notes/pointers so that i can keep track of things

<!----garbish--->

thanks for the help but i am really in need of something that can do it in batch order , you know , select directory , hit go and strip the coding that i want taken out , i have quite a number of files , so doing it one by one would be time consuming

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.