Changing particular tag value of xml file

Hi All,

I have number of xml file like :
______________________________________________________
<?xml version="1.0" standalone="no"?>
<!-- Created by Symology Ltd on 13/02/2012 - USER_BATCH_ID 0011091684 -->
<!-- RECIPIENT_URL: HTTP://194.168.0.81:3408 -->
<EToNrequest
SchemaVersion="5.0"
xsi:schemaLocation="http://www.wrcplc.co.uk/Schemas/ETON EToNrequest-v5-0.xsd"
xmlns="http://www.wrcplc.co.uk/Schemas/ETON"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NewActivity>
<NotificationType>0200</NotificationType>
<NotificationSequenceNumber>004</NotificationSequenceNumber>
_________________________________________________

I need to change IP address <!-- RECIPIENT_URL: HTTP://194.y.0.z:3408 -->
to
<!-- RECIPIENT_URL: HTTP://192.y.0.a:3408 --> in all the files..

Thanks
Krsnadasa

Not tested:

There is a string function 'gsub' for commandline tool 'awk'. The GNU Awk User's Guide

replace matches of regular expression...

Try:

perl -i -pse 's#<!-- RECIPIENT_URL: HTTP://194.168.0.81:3408 -->#<!-- RECIPIENT_URL: HTTP://$ip:3408 -->#' -- -ip="192.y.0.a" *

Thanks Both,

I tried with perl and it is working perfectly. Thanks bartus11. I need one more help can you please explain the command completely different terms you used. As i am new in perl. So that in future I can use this.

Thanks
Krsna..

you can use sed utility too.

Thanks,
Kalai

This perl one-lines is really one command "s///" with "#" used as delimiter.

Thanks kalpeer and bart again,

sed is working but perl is better as it is changing only on particular tag.

Bart do you have nay doc or ref doc so that I can also practise perl one liner with #.

Thanks All..

To use Perl one-liners, you should first read this: perlrun - perldoc.perl.org