Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Search and replace programs? Anyone?

    The problem is a menu table, now this isn't 'exactly' the same on every page but it is on more than 90 pages and I need to add a cell with onmouseover, CSS class and color attributes.. and inside it needs to be a link with the same class and onmouseover.. yea?

    It would be SO simple if I could put in document.getElementById('main_tab') to the program (to reference it by the object ID) but few programs even take tags into consideration never mind IDs, I'm trying to write something to do this in perl, but my skills in that language are mediocre at best.

    If anyone knows of any search - replace programs that could do this.. I'd really appreciate it.

    Thanks.
    corrie track

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there something in the tag that is unique? And how much do you need to replace? Just the <tag> or <tag>content</tag>
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there something unique? Yea the id tag lol{<table id=”main_tab”>} -- I really need to replace the table with a brand new one (its actually not much different - a new cell and info in the cell), got any programs in mind?
    The link names are all the same too ( a href= inside the cells).. I think their all going to the right place (lol)
    corrie track

  • #4
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, 'my' texteditor can do it but it still would take some scripting so it isn't plug and play.

    So maybe Perl as you suggested is a better solution.
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Try homesite

    Perhaps that might have what you want.
    Therapy is expensive, popping bubble wrap is cheap, you choose.

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Show us the text you want to 'find' and that which you want to 'replace' it with.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #7
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Beetle - listed the before and after, the percentages need changing too, but you get the idea.. where I say 'misc changing info' I literally mean that this is different on every page.. also the spaces and carriage returns (\n) are different per page (it was originally created by someone else on dreamweaver), I have drop-down tables generated by JavaScript in a js file (all the script needs to work is the percentages) I should just have dynamically generated the links on this table too, but they were already in place when I got the job...

    Meow - thanks, I'll try it...




    <table id="main_tab" width="98%" border="1" height="73">
    <tbody><tr bgcolor="#003366">
    <td id="pannel" class="main_lnk" width="15%" align="center" onClick="o_min(0)">
    <a class="main_lnk" onmouseOver="shw_it(0)" href="javascript:o_min(0)">Link1</a>
    </td>
    <td class="main_lnk" width="17%" align="center" onClick="o_min(1)">
    <a class="main_lnk" onmouseOver="shw_it(1)" href="javascript:o_min(1)">Link2</a>
    </td>
    <td class="main_lnk" width="15%" align="center" onClick="o_min(2)">
    <a class="main_lnk" onmouseOver="shw_it(2)" href="javascript:o_min(2)">Link3</a>
    </td>
    <td class="main_lnk" width="19%" align="center" onClick="o_min(3)">
    <a class="main_lnk" onmouseOver="shw_it(3)" href="javascript:o_min(3)">Link4</a>
    </td>
    <td class="main_lnk" width="18%" align="center" onClick="o_min(4)">
    <a class="main_lnk" onmouseOver="shw_it(4)" href="javascript:o_min(4)">Link5</a>
    </td>
    <td class="main_lnk" width="16%" align="center" onClick="o_min(5)">
    <a class="main_lnk" onmouseOver="shw_it(5)" href="javascript:o_min(5)">Link6</a>
    </td>
    </tr>
    <tr onmouseOver="shw_it(6)">
    <td colspan="6" height="42">
    <div id="blurb_it" align="center">
    <p><font face="Comic Sans MS" size="-1" color="#cc0000"><b>Misc [changing] info</font></b></font></p>
    </div>
    </td>
    </tr>
    </tbody></table>

    to

    <table id="main_tab" width="98%" border="1" height="73">
    <tbody><tr bgcolor="#003366">
    <td id="pannel" class="main_lnk" width="15%" align="center" onClick="o_min(0)">
    <a class="main_lnk" onmouseOver="shw_it(0)" href="javascript:o_min(0)">Link1</a>
    </td>
    <td class="main_lnk" width="17%" align="center" onClick="o_min(1)">
    <a class="main_lnk" onmouseOver="shw_it(1)" href="javascript:o_min(1)">Link2</a>
    </td>
    <td class="main_lnk" width="15%" align="center" onClick="o_min(2)">
    <a class="main_lnk" onmouseOver="shw_it(2)" href="javascript:o_min(2)">Link3</a>
    </td>
    <td class="main_lnk" width="19%" align="center" onClick="o_min(3)">
    <a class="main_lnk" onmouseOver="shw_it(3)" href="javascript:o_min(3)">Link4</a>
    </td>
    <td class="main_lnk" width="18%" align="center" onClick="o_min(4)">
    <a class="main_lnk" onmouseOver="shw_it(4)" href="javascript:o_min(4)">Link5</a>
    </td>
    <td class="main_lnk" width="16%" align="center" onClick="o_min(5)">
    <a class="main_lnk" onmouseOver="shw_it(5)" href="javascript:o_min(5)">Link6</a>
    </td>
    <td class="main_lnk" width="16%" align="center" onClick="o_min(6)">
    <a class="main_lnk" onmouseOver="shw_it(6)" href="javascript:o_min(6)">Link7</a>
    </td>
    </tr>
    <tr onmouseOver="shw_it(6)">
    <td colspan="6" height="42">
    <div id="blurb_it" align="center">
    <p><font face="Comic Sans MS" size="-1" color="#cc0000"><b>Misc changing info</font></b></font></p>
    </div>
    </td>
    </tr>
    </tbody></table>
    corrie track

  • #8
    WA
    WA is offline
    Administrator
    Join Date
    Mar 2002
    Posts
    2,596
    Thanks
    2
    Thanked 19 Times in 18 Posts
    Well, when I changed the name of JavaScriptKit.com (from Wsabstract.com), I needed something robust to recognize various matches, such as WA, Website Abstraction, Wsabstract.com etc. Finally found a search-and-replace program that allowed to me to just that, called ReplaceEm 2.0:

    http://download.com.com/3000-2248-49...ml?legacy=cnet

    Worked like a charm. Supports wild cards, so it's up to you to come up with the appropriate formula.
    - George
    - JavaScript Kit- JavaScript tutorials and 400+ scripts!
    - JavaScript Reference- JavaScript reference you can relate to.

  • #9
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    WA - hmm, I had a look at that one, didn't know it had wildcards.. I skipped it cause it didn't look like it could understand tags, will give it another shot, by the way I remember the change, and I think I remember that thread.. I wanted to keep abstract lol.

    Meow - that is a funky notepad lol, I've been using the standard MS txt reader for all my code, not sure if its going to help me with this, but I'm certainly going to get into it, looks handy as hell.



    thanks.
    corrie track

  • #10
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    WA - thanks, I think this is gona do, one thing, you don't know how to put carriage returns into it.. do you? (\n).. I read through the help, searched there site.. even run a search on altavista lol. ( I've tried {}r {}n and actual returns followed by an * ) I have it on 'regular expression search' and think I have everything else working.
    corrie track

  • #11
    WA
    WA is offline
    Administrator
    Join Date
    Mar 2002
    Posts
    2,596
    Thanks
    2
    Thanked 19 Times in 18 Posts
    Originally posted by cortic
    WA - thanks, I think this is gona do, one thing, you don't know how to put carriage returns into it.. do you? (\n).. I read through the help, searched there site.. even run a search on altavista lol. ( I've tried {}r {}n and actual returns followed by an * ) I have it on 'regular expression search' and think I have everything else working.
    Hmmm...honestly I can't tell you, since it's been a long time since I last used the program.
    - George
    - JavaScript Kit- JavaScript tutorials and 400+ scripts!
    - JavaScript Reference- JavaScript reference you can relate to.

  • #12
    Regular Coder
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by cortic
    WA - thanks, I think this is gona do, one thing, you don't know how to put carriage returns into it.. do you? (\n).. I read through the help, searched there site.. even run a search on altavista lol. ( I've tried {}r {}n and actual returns followed by an * ) I have it on 'regular expression search' and think I have everything else working.
    Just a guess, but try...
    ^P

  • #13
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the suggestion pb&j, it was '{}e' found it by mistake lol (the prog replaces actual carriage returns with {}e after the edit window is shut down and opened again)

    Have another issue with this, maybe this is more global though, so I hope someone can help, in ranges the prog searched ASCII text like [a-z]* is searching for anything from ASCII a to z and stopping when it finds something else (like a space or a cap or something).. does someone know (or have a link to) the full ASCII character list.. in order? This is so I can allow for things inside the element on the page, so I can add non-alphanumerical characters into range searches.

    Thanks.
    corrie track

  • #14
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    i've tried ReplaceEm, but i was much happier with the following program:

    http://www.silveragesoftware.com/hffr.html

    it has a better interface, i think, and allows for regular expressions, searches by date, and a couple of other nice features.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #15
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks joh6nn, its incredibly user friendly! I get the feeling there is more I could do with ReplaceEm but I think this is going to do for now (hopefully).

    does anyone know the ASCII character order? I'm interested to know this anyway cause it seems to be a pivotal point of these search programs..
    corrie track


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •