in reply to Re: match and remove across multiple lines
in thread match and remove across multiple lines

Here is a sample code that works for me. I basically hv to direct the output to another file when I run the script and its working fine. But is there any way to manipulate the insert within the source file itself?.

Also I am worried about the large xml file and how my memory might be effected

while (<FILE>) { $match++ if $match; if(/$same/){ # When we see <pattern> start storing the data $match = 1; } $match = 0 if (/APPLES=*/); next if ($match == 1); next unless $match; s/\<Row AutoFitHeight=*//; print "$_"; } foreach $o(sort keys %{$application{$key}}){ print $boots{$s}{$o}\n"; } else { print "0\n"; } } print " $cnt{$s}\n"; print " $date\n"; } close (FILE)

Edit: g0n - code tags