[Nottingham] A little scripting on a Sunday evening (help please)

Joshua Lock incandescant at gmail.com
Sun Apr 9 18:30:28 BST 2006


Afternoon folks,

<STORY>
I have offered to take my friends static HTML web site of > 90 pages  
in multiple directories (with spaces in directory names) and make it  
easier for him to keep up to date.
I aim to do this by moving javascript and css to separate files and  
have them linked into the pages.
I also want to move some common code into a separate file and PHP  
include it.
</STORY>

<PROBLEM>
The files all have the suffix .html and all link to each other...
</PROBLEM>

I'm looking to have some script iterate through all of sites  
directory tree and rename the files from *.html to *.php. I then want  
the script (or a different script) to (regular expression?) scan the  
files for anchor tags and convert the .html suffixes to .php.

I'm not asking someone to write such a script for me (although I  
would gratefully and gladly accept and existing solution); just some  
pointers to documentation to help me do this or even a hint at what  
tools to use?
I haven't touched regular expressions but need to learn some time,  
I'm also thinking of delving into Perl so any pointers in that  
direction would be gratefully accepted :)

I really don't fancy doing this by hand :s

Best wishes,

J
--
Joshua Lock
incandescant at googlemail.com



More information about the Nottingham mailing list