![]() |
|
|
|||||||
![]() |
HTML - Tools for searching and replacing code |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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! |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
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 |
|
|
|
#6 |
|
Posts: n/a
|
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. |
|
|
|
#7 |
|
Posts: n/a
|
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. |
|
|
|
#8 |
|
Posts: n/a
|
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). |
|
|
|
#9 |
|
Posts: n/a
|
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 |
|
|
|
#10 |
|
Posts: n/a
|
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! |
|