[Tutor] Substitution question...

montana montana@buc99.bsd.st
Tue Feb 11 23:38:06 2003


Hi Everyone-

I Would like to open a list of files an re-write them all to new filenams.  I know how to do this with a for loop and then open each file for reading and then writing them to a new file name.  My question deals more with substitution in the filenames. For insatnce:

I know that all of the files contain  five letters followed by a number that couls be 1or 2 digits followed by .html. --> xxxxx1.html or xxxxx12.html

What I would like to do is lopp off the 'xxxxx' and replace with 'yyy' so the previous example would end up with yyy1.html and yyy12.html.

(of course the '1' and '12' could be any number that is between 1 and 2 digits long)

How can I accomplish this easily.

Thanks.
SA
:)