I have just done an xml dump of several thousand records from a db.
I have to actually go through each one as the xml from the db has the
following:

<item name="MetaData">
<value>
</value>
</item>
(all the values in these fields are empty)

but needs to have this instead:

<item name="MetaData">
<value>
<item name="prod"/>
<item name="features"/>
</value><value>
<item name="prod"/>
<item name="features"/>
</value>
</item>

I thought this might work but it does not do a substitution:
        while (<FILE>) {
        $_ =~ s|(<item name="MetaData"><value>)|$1<item name="prod"/><item
name="features"/></value><value><item name="prod"/><item
name="features"/>|smg;
        print $_;
        }

Is there an easy way to do this?

Thanks!

Nikko
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to