Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

renaming the url globally

Status
Not open for further replies.

thendal

Programmer
Joined
Aug 23, 2000
Messages
284
Hi all !

I would like to rename the link in all the html pages
from
<a href=&quot; to

<a href=&quot;
under certain directory and all the files under the subsequent subdirectories

in other words renaming a string in all html pages to another string in all subsequent directories ...

could some one help with the regular expression ...

Any help will be greatly appreciated.

Thanks
 
Hi, you can use MS Frontpage. File->Open Web, select the home directory of your website (eg c:\Inetpub\www) go to Edit->Replace
Find what: <a href=&quot;Replace with: <a href=&quot;
And make sure you use search options: All pages
Once the search is done, just do replace all. That's it.
Hope this help.
 
If you download EditPlus, you can use the &quot;Find in Files&quot; command to find all the files where the url occurs and open them in the editor. Then you can use Search and Replace and check the &quot;All Open Files&quot; option to change all the URLs at once. Then just &quot;Save All&quot; and reupload them. I've done this sort of thing several times with EditPlus and it fast and easy. You can get EditPlus at Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks vietglobe ..this helps if i have 10 -50 html pages ..

my problem is i am having tons of html pages need to changed ..it requires lot of manual hours..

to over come that
i am trying to write a script ..
which opens up all the html files in a directory and subsequent directories and replace the string &quot; to &quot;
I think thats the power of perl which can manipulate
tons of files in a fraction of seconds.

Thanks for your quick reply.

:)

.
 
Oops i didn't see tsdragon's message ..

Thanks tsdragon yeah it works ....

But i feel it will be cool tool if everything happens on the server side itself

mention the directory path /home/dkdsk

and the string need to find &quot;
and the string need to replaces &quot;
so we will save the time in reuploading to the server..

i think it seems possible using perl....

Any way thank you very much for your quick reply

:)
 
I have a program that you can probably modify to do what you want. It's intended to &quot;fix&quot; html files created from MSWord, but the basic outline of the program is what you want to do (i.e. open all files with a certain filespec and do a search and replace on them). Let me know if you're interested and I'll email the program to you. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks for the quick reply .. you can email me the program at
neoanderson23@yahoo.com

Again Thanks a lot

:)



 
If anyone else needs a program that will process one or more files, automatically create backup files, allows command line switches, and is designed to be VERY easy to customize to suit your needs (I put lots of CUSTOMIZE comments in it to tell you what/how to change it), go to this URL and get the program:

Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top