you could do this with a regular expression in Perl. it's much simpler if
it
is all on 1 line. (you don't use the m in front of the search string)
I think the search and replace line would look something like
use IO::File;
$FH1=100;
$FH2=101;
open(FH1, "r<myfile.html") or die "can't open file. $!";
open(FH2, "w>newfile.html") or die "can't create file. $!";
while (<FH1>) {
$_ =~ s/<[hH][eE][aA][dD] .*>/<head>/g;
print FH2 $_;
}
close(FH1);
close(FH2);
why not take this to the Perl group?
many editors also handle regular expressions, such as The Semware Editor,
which is fairly cheap. (semware.com)
<out@[EMAIL PROTECTED]
> wrote in message
news:c1svk1hkoatosnrqrtmrvdqujdt9hkt7at@[EMAIL PROTECTED]
> Hello,
>
> I have a website and I want to replace the head tag in all the pages
> with a new and better one.
> Some pages on my current site have meta data in the head tag and some
> do not.
> Is there a way of doing this "automaticly" (batch) without edit every
> page manually?
>
>
> Jon
>
>
>
>
>
>


|