There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen blue screen of death boot bsod computer connection crash css dell display driver drivers email error explorer firefox firefox 3 hard drive internet internet explorer itunes laptop lcd malware monitor network networking outlook outlook 2003 outlook express printer problem problems ram router security slow software sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
replace regex in multiple files (in or out of dreamweaver)


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
cpscdave's Avatar
Senior Member with 281 posts.
 
Join Date: Feb 2004
Experience: Intermediate
22-May-2008, 12:02 PM #1
replace regex in multiple files (in or out of dreamweaver)
I need to make the same change to about 45 html files. (I didnt set this up and am kinda pissed off at how it was)

Anyone know a way I can do this in multiple files??

Idealy I'd like to be able to tell some program to change
<a href="someurl.html"> someurl</a>
to
<a href="someurl2.html> someurl2</a>

I could do it w/ an xemacs macro but still would have to apply it to every file one at a time...

GRRRR
__________________
Its not a bug.... Its a feature!

Programming today is a race between software engineers striving to build bigger and better idiot-proof
programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-Rick Cook

Spam a problem for you? http://spamooze.com
TroyTime's Avatar
Computer Specs
Junior Member with 12 posts.
 
Join Date: Apr 2008
Experience: programmer for 10 years, but new to vista
22-May-2008, 02:56 PM #2
if you have dreamweaver, it likely came with homesite
homesite USED to come with a replace in files that could use regular expressions...not sure if it still does or not
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,716 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
22-May-2008, 03:59 PM #3
Quote:
Originally Posted by cpscdave View Post
I could do it w/ an xemacs macro but still would have to apply it to every file one at a time...
Do you have access to a Linux or Unix box? If so, you can use sed.

Example:

$ sed "s/someurl/someurl2/" {input file} > {output file}

Then you could put that in a loop:

$ for f ({list of input files}); sed "s/someurl/someurl2/" $f > output_files/$f; done

That's not the exact syntax but that illustrates the point.

Peace...
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:54 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.