in reply to Slurping and s/// a group of files from a list
All your original files will be renamed to be something like foo.html.orig (use perl -pi -e if you don't care about backups).perl -pi'.orig' -e 'BEGIN {open(FH,"alt_tag_file"); @alltags = <FH>; c +homp @alltags;}; @tags = @alltags unless(scalar(@tags)); s/(<img)([^> +]+>)/@T = ($1,$2); $T[0].($T[1] =~ m,\balt=, ? "" : q{ alt="}.shift(@ +tags).q{"}).$T[1]/eg *.html *.htm *.shtml
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Slurping and s/// a group of files from a list
by davido (Cardinal) on Nov 02, 2004 at 19:19 UTC |