eggmatters
Programmer
I am attempting to 'find and replace' content in a rather large XML file. Basically, I am exporting data from an excel spreadsheet into a Visio. Some of the fields don't match directly due to existence of newlines, spaces, special characters and other subtle differences between tags. Roughly, the schema is:
<Text><meta data and custom tags and attributes>Data to be sought</meta data and custom tags and attributes></Text>.
the the variable containing the pattern being sought is the entire file as one variable: $infile.
One problem I encounter is when I write the expression:
$infile =~ s/(<Text>)(.*)(<\/Text>)/$marker/s;
it replaces everything between the first and the last text tag. I need it to be able to find each text tag.
<Text><meta data and custom tags and attributes>Data to be sought</meta data and custom tags and attributes></Text>.
the the variable containing the pattern being sought is the entire file as one variable: $infile.
One problem I encounter is when I write the expression:
$infile =~ s/(<Text>)(.*)(<\/Text>)/$marker/s;
it replaces everything between the first and the last text tag. I need it to be able to find each text tag.