Tools for searching and replacing code

Discussion in 'HTML' started by Robert, Nov 30, 2004.

  1. Robert

    Robert Guest

    I have many sites with individual css, javascript, and html code.
    Sometimes, I find myself updating multiple CSS files for different
    sites on my hard drive. Do any tools exist for changing code across
    multiple sites including CSS, HTML, and JavaScript with regular
    expression support? For example, I would like to change margins (from
    6px to 60px) in the body elements for 30 CSS files. The ideal tool
    would allow me to select a directory (& subfolders), search for the
    text files (CSS HTML, JavaScript, etc), and replace the code.

    I would appreciate any recommendations.
    Robert, Nov 30, 2004
    #1
    1. Advertising

  2. On Tue, 30 Nov 2004 10:30:53 -0800, Robert wrote:

    > I have many sites with individual css, javascript, and html code.
    > Sometimes, I find myself updating multiple CSS files for different
    > sites on my hard drive. Do any tools exist for changing code across
    > multiple sites including CSS, HTML, and JavaScript with regular
    > expression support? For example, I would like to change margins (from
    > 6px to 60px) in the body elements for 30 CSS files. The ideal tool
    > would allow me to select a directory (& subfolders), search for the
    > text files (CSS HTML, JavaScript, etc), and replace the code.
    >
    > I would appreciate any recommendations.


    perl -pie 's/6px/60px/' *.css */*.css */*/*.css

    That oughtta do it. I'm gonna get some flak as to why this solution is
    not flexible enough or easy enough to use, bu I have retorts for all
    complaints.

    later...

    --
    Jeffrey D. Silverman |
    Website | http://www.newtnotes.com

    Drop "PANTS" to reply by email
    Jeffrey Silverman, Nov 30, 2004
    #2
    1. Advertising

  3. While the city slept, Jeffrey Silverman () feverishly
    typed...

    [...]
    > I have retorts for all complaints.


    Ooh! A challenge! Here's one for you then;

    "My bus to work was late this morning."

    Retort away ;-)

    Cheers,
    Nige

    --
    Nigel Moss
    http://www.nigenet.org.uk
    Mail address not valid. , take the DOG. out!
    In the land of the blind, the one-eyed man is very, very busy!
    nice.guy.nige, Nov 30, 2004
    #3
  4. Robert wrote:
    > I have many sites with individual css, javascript, and html code.
    > Sometimes, I find myself updating multiple CSS files for different
    > sites on my hard drive. Do any tools exist for changing code across
    > multiple sites including CSS, HTML, and JavaScript with regular
    > expression support? For example, I would like to change margins (from
    > 6px to 60px) in the body elements for 30 CSS files. The ideal tool
    > would allow me to select a directory (& subfolders), search for the
    > text files (CSS HTML, JavaScript, etc), and replace the code.
    >
    > I would appreciate any recommendations.
    >


    Textpad has some excellent search and replace facilities, using regular
    expressions - use the 'Find In Files CTRL+F5' function (remember to tick
    'Include Subfolders') to do what you want.
    HTH

    --
    Peter
    nativespace - hosting & domain names
    providers of advanced, affordable UK hosting since 2001
    http://www.nativespace.com
    Peter - nativespace hosting, Nov 30, 2004
    #4
  5. On Tue, 30 Nov 2004 21:02:14 +0000, nice.guy.nige wrote:

    > Ooh! A challenge! Here's one for you then;
    >
    > "My bus to work was late this morning."
    >
    > Retort away ;-)


    Hah! That's easy.

    If you're gonna be late anyways, then stop by the bagel store and pick me
    up a regular coffee and a sesame bagel, light cream cheese. And maybe a
    newspaper.

    --
    Jeffrey D. Silverman |
    Website | http://www.newtnotes.com

    Drop "PANTS" to reply by email
    Jeffrey Silverman, Nov 30, 2004
    #5
  6. Robert

    Robert Guest

    On Tue, 30 Nov 2004 16:55:17 -0500, Jeffrey Silverman
    <> wrote:

    >On Tue, 30 Nov 2004 21:02:14 +0000, nice.guy.nige wrote:
    >
    >> Ooh! A challenge! Here's one for you then;
    >>
    >> "My bus to work was late this morning."
    >>
    >> Retort away ;-)

    >
    >Hah! That's easy.
    >
    >If you're gonna be late anyways, then stop by the bagel store and pick me
    >up a regular coffee and a sesame bagel, light cream cheese. And maybe a
    >newspaper.



    Retort…hmm…You have given a man fish for the day and he thanks you;
    teach a man to fish and he'll be indebted to you for he will not go
    hungry.

    Perl sound great, yet I am less familiar with the related tools and
    compilers. Could you give me more insight on learning this stuff for
    practical use? In addition, my request extends to searching blocks of
    text like paragraphs and entire class selectors.

    I just began familiarize myself with Dreamweaver's Find and Replace
    extension engine (2004). It has regular expression support and one
    could save searches. Now, I have figure out searching in folders and
    compiling a search list (hmm ponders a Google search).

    Entertain us with leading a man to the ocean or help us clean our
    catch and prepare for the next day. Unti then, I'll see you at the
    docks another day for fish.
    Robert, Dec 1, 2004
    #6
  7. Robert

    Neal Guest

    Robert wrote:

    > Retort…hmm…You have given a man fish for the day and he thanks you;
    > teach a man to fish and he'll be indebted to you for he will not go
    > hungry.


    Or..

    Give a man a fish, he eats today. Teach a man to fish, he has an excuse to
    drink beer in a boat at 5 AM.
    Neal, Dec 1, 2004
    #7
  8. Robert

    Robert Guest

    On Tue, 30 Nov 2004 21:38:16 +0000, Peter - nativespace hosting
    <> wrote:

    >Robert wrote:
    >> I have many sites with individual css, javascript, and html code.
    >> Sometimes, I find myself updating multiple CSS files for different
    >> sites on my hard drive. Do any tools exist for changing code across
    >> multiple sites including CSS, HTML, and JavaScript with regular
    >> expression support? For example, I would like to change margins (from
    >> 6px to 60px) in the body elements for 30 CSS files. The ideal tool
    >> would allow me to select a directory (& subfolders), search for the
    >> text files (CSS HTML, JavaScript, etc), and replace the code.
    >>
    >> I would appreciate any recommendations.
    >>

    >
    >Textpad has some excellent search and replace facilities, using regular
    >expressions - use the 'Find In Files CTRL+F5' function (remember to tick
    >'Include Subfolders') to do what you want.
    >HTH


    I forgot about Textpad, one of my favorite applications. The regular
    expression support is not ideal, yet if I could compile search and
    replace list, then it could be workable. Let me know if you have any
    additional insights.

    In addition, my request extends to searching blocks of text like
    paragraphs and entire class selectors.

    I just began familiarize myself with Dreamweaver's Find and Replace
    extension engine (2004). It has regular expression support and one
    could save searches. Now, I have figure out searching in folders and
    compiling a search list (hmm ponders a Google search).
    Robert, Dec 1, 2004
    #8
  9. Robert

    Spartanicus Guest

    Robert <robert-neville310@> wrote:

    >I forgot about Textpad, one of my favorite applications. The regular
    >expression support is not ideal, yet if I could compile search and
    >replace list, then it could be workable. Let me know if you have any
    >additional insights.


    >In addition, my request extends to searching blocks of text like
    >paragraphs and entire class selectors.


    Homesite has a multi line, multi file or directory wide S&R, it also
    supports regexps albeit in a limited fashion.

    Alternatively you could look at TextPipe.

    --
    Spartanicus
    Spartanicus, Dec 1, 2004
    #9
  10. While the city slept, Jeffrey Silverman () feverishly
    typed...

    >>> "My bus to work was late this morning."

    >>
    >> Retort away ;-)

    >
    > Hah! That's easy.
    >
    > If you're gonna be late anyways, then stop by the bagel store and
    > pick me up a regular coffee and a sesame bagel, light cream cheese.
    > And maybe a newspaper.


    Damn! You're good! ;-)

    Cheers,
    Nige

    --
    Nigel Moss
    http://www.nigenet.org.uk
    Mail address not valid. , take the DOG. out!
    In the land of the blind, the one-eyed man is very, very busy!
    nice.guy.nige, Dec 1, 2004
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris
    Replies:
    5
    Views:
    8,046
    Christopher R. Barry
    Oct 11, 2003
  2. Christopher R. Barry

    Re: Searching/replacing multiple words in input.

    Christopher R. Barry, Oct 11, 2003, in forum: Java
    Replies:
    1
    Views:
    2,058
    John Kordyback
    Oct 12, 2003
  3. Oltmans

    Searching and replacing text ?

    Oltmans, May 2, 2008, in forum: Python
    Replies:
    2
    Views:
    247
  4. Rob Meade

    Replacing - and not Replacing...

    Rob Meade, Apr 5, 2005, in forum: ASP General
    Replies:
    5
    Views:
    273
    Chris Hohmann
    Apr 11, 2005
  5. stumblng.tumblr
    Replies:
    1
    Views:
    202
    stumblng.tumblr
    Feb 4, 2008
Loading...

Share This Page