Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - Tools for searching and replacing code

 
Thread Tools Search this Thread
Old 11-30-2004, 06:30 PM   #1
Default Tools for searching and replacing code


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
  Reply With Quote
Old 11-30-2004, 06:42 PM   #2
Jeffrey Silverman
 
Posts: n/a
Default Re: Tools for searching and replacing code

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

  Reply With Quote
Old 11-30-2004, 09:02 PM   #3
nice.guy.nige
 
Posts: n/a
Default Re: Tools for searching and replacing code

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!


  Reply With Quote
Old 11-30-2004, 09:38 PM   #4
Peter - nativespace hosting
 
Posts: n/a
Default Re: Tools for searching and replacing code

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
  Reply With Quote
Old 11-30-2004, 09:55 PM   #5
Jeffrey Silverman
 
Posts: n/a
Default Re: Tools for searching and replacing code

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

  Reply With Quote
Old 12-01-2004, 08:25 AM   #6
Robert
 
Posts: n/a
Default Re: Tools for searching and replacing code

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.

  Reply With Quote
Old 12-01-2004, 08:29 AM   #7
Neal
 
Posts: n/a
Default Re: Tools for searching and replacing code

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.
  Reply With Quote
Old 12-01-2004, 08:29 AM   #8
Robert
 
Posts: n/a
Default Re: Tools for searching and replacing code

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).


  Reply With Quote
Old 12-01-2004, 08:47 AM   #9
Spartanicus
 
Posts: n/a
Default Re: Tools for searching and replacing code

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
  Reply With Quote
Old 12-01-2004, 05:32 PM   #10
nice.guy.nige
 
Posts: n/a
Default Re: Tools for searching and replacing code

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!


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump