in reply to Re^2: Large file processing
in thread Large file processing
#Usage: <Support-File> <Input-File> undef $/; open(TEXT, $ARGV[0]) or die $!; my $text = <TEXT>; close TEXT; open(XML, $ARGV[1]) or die $!; my $xml = <XML>; close XML; while($text =~ m/\/(.+)\/([^\/]+)\/[^\/]+$/mgi) { my $FindWord = $1; my $ReplaceWord = $2; $xml =~ s/(>[^>]*\b)\Q$FindWord\E(\b[^>]*<)/$1$ReplaceWord$2/gi; } open(OUTXML, ">$ARGV[1]") or die $!; print OUTXML $xml; close OUTXML;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Large file processing
by ikegami (Patriarch) on Oct 01, 2010 at 07:00 UTC | |
by arivu198314 (Sexton) on Oct 01, 2010 at 09:09 UTC | |
|
Re^4: Large file processing
by GrandFather (Saint) on Oct 01, 2010 at 07:02 UTC | |
by ikegami (Patriarch) on Oct 01, 2010 at 16:52 UTC |