script to change or remove content

Discussion in 'Programming' started by tyggemannen, Sep 9, 2006.

  1. #1
    Hi.
    I have several websites where I need to change the content. The problem is that the content are unique for every page. What is not unique is the start of every line in the source code. It can start with for example:
    "<p align="left" class="style17">Here you have"
    then the rest of that line is unique.

    What I am looking for is a script that can remove all lines starting with
    "<p align="left" class="style17">Here you have"
    or any other text of my choise.

    Hope you know what I mean. Do any of you have a script like this ?

    All the best, chowbow.
     
    tyggemannen, Sep 9, 2006 IP
  2. freecbc3

    freecbc3 Peon

    Messages:
    953
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ???????????
     
    freecbc3, Sep 10, 2006 IP
  3. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Did you have question in front of that ???????? : )

    Ok, one of my pages source code looks like this:

    <div id="masthead">
    <h1 id="siteName"> the apes calling four evenly freezing people.</h1>
    <h2 id="pageName"><br />
    <span class="style7">Here you go, the link to apes of man</span></h2>
    <p> <span class="style8">-
    the apes of man calling four evenly freezing people. </span></span><br />
    </p>
    </div>

    another page source code is like this (second and sixth line is different):

    <div id="masthead">
    <h1 id="siteName"> the apes walking to and from the house.</h1>
    <h2 id="pageName"><br />
    <span class="style7">Here you go, the link to apes of man</span></h2>
    <p> <span class="style8">-
    the apes walking to and from the house.
    </span></span><br />
    </p>
    </div>

    I have thousands of pages like this with partly different source code.
    I want to remove the entire line beginning with:
    <h1 id="siteName"> the apes
    because that is the thing all the pages has in common.

    So a php script or whatever have to tell the thousands of files (html pages) to remove the entire lines beginning with <h1 id="siteName"> the apes

    Is this easier to understand ?
     
    tyggemannen, Sep 10, 2006 IP