Hi All,
I have a file say abc.xml. In this file, I need to search for a pattern �SAP_GATEWAY_HOST�; if this pattern found and the next line also contain the pattern �nwprc03.cos� then I need to replace this pattern �nwprc03.cos� with some other pattern �nwdrc03.apjp�.
$ cat abc.xml
<NameValuePair>
<name>SAP_APPLICATION_HOST</name>
<value>nwprc00.cos</value>
</NameValuePair>
<NameValuePair>
<name>SAP_GATEWAY_HOST</name>
<value>nwprc00.cos</value>
</NameValuePair>
Required abc.xml should be:
$ cat abc.xml
<NameValuePair>
<name>SAP_APPLICATION_HOST</name>
<value>nwprc00.cos</value>
</NameValuePair>
<NameValuePair>
<NameValuePair>
<name>SAP_GATEWAY_HOST</name>
<value>nwdrc01.apjp</value>
</NameValuePair>
Thanks,
Ritesh Jain