Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Scripts to recursively reading in HTML files

by vladdrak (Monk)
on Sep 01, 2004 at 07:21 UTC ( #387417=note: print w/replies, xml ) Need Help??


in reply to Scripts to recursively reading in HTML files

It's probably best to use an .htaccess like solution if you can. If you decide to do a find & replace, or are curious as to how this might be done for something else:

Unix
perl -pibak -e 's/src\=\"\'/src\=\'\.\.\//' `find /basepath -name *.ht +ml`
Windows
for /f %i in ('dir /s/b d:\basepath | findstr html$') do perl -pibak - +e 's/src\=\"\'/src\=\'\.\.\//' %i
This will perform substitution on all html files underneath the specified base directory, and make a backup file (ext bak) for each edited file. You'll probably want to season to taste, and practice on a backup a couple times.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2023-02-07 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (40 votes). Check out past polls.

    Notices?