Link to home
Start Free TrialLog in
Avatar of ClaySmith
ClaySmith

asked on

Add log feature to script: "Replace " " with « » inside the xml files"

Ozo,
Feature Request on below script please.
- Create log file to list names of those files changed by ->  if s/(<title>.*?)"(.*?)"/$1«$2»/s;

100 Bonus points due to slight urgent need...



use open ':utf8';
$/="</title>";
use File::Find;

find(sub{
    print STDERR "$File::Find::name\n";
    return unless /\.xml$/;
    local @ARGV=($_);local $^I=".bak";
    while( <> ){ print STDERR "$1«$2»\n" if s/(<title>.*?)"(.*?)"/$1«$2»/s; print; }
},".");
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial