Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Changing .html to .asp

by THRAK (Monk)
on Apr 27, 2001 at 22:08 UTC ( [id://76199]=note: print w/replies, xml ) Need Help??


in reply to Changing .html to .asp

If all you need/want to do is change every HREF from a ".html" to ".asp" extension, that should be fairly easy. Build a list of all of the files you need to change and then read that file. For each entry open the file and parse it line by line looking for HREF's. When you find a HREF, do a  s/.html/.asp/ on that line. Depending how clean your HTML is, this may/may not work as there could be multiple .html referenced on each line if it's not layed out well. If it's clean this sort of thing should work. If you have ugly HTML that is not formatted well you will have to refine things to make sure you only match what you want to change.

-THRAK
www.polarlava.com

Replies are listed 'Best First'.
Re: Re: Changing .html to .asp
by little (Curate) on Apr 27, 2001 at 22:31 UTC
    THRAK, just to avoid the risk of changing the documents content as well then better make sure in your substitution that you dont match > inbetween HREF and .(s|p)?htm(l)? and ignore the case. :-)

    Have a nice day
    All decision is left to your taste

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://76199]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found