Hi,
I need a script to start searching a word from the particular record on the result of first occurence i need to change the value in that record.
I have a input file like this
<properties>
<add key="DeliveryWithinDay" value="False" />
<add key="ABC" value="23:00:00 PM" />
<add key="DEF" value="(GMT-06:00) " />
<add key="CVB" value="90" />
<add key="XCB" value="2" />
<add key="Restarts" value="0" />
</properties>
<properties>
<add key="ContactAddress" value="Home" />
<add key="AttemptInterval" value="10" />
<add key="Restarts" value="1000" />
<add key="DEF" value="(GMT-06:00) " />
<add key="CVB" value="90" />
<add key="RestartInterval" value="600" />
</properties>
<properties>
<add key="DeliveryNextDay" value="False" />
<add key="ABC" value="23:00:00 PM" />
<add key="DEF" value="(GMT-06:00) " />
<add key="CVB" value="90" />
<add key="XCB" value="2" />
<add key="Restarts" value="50" />
<add key="XAB" value="2" />
</properties>
I would like to search a word "ContactAddress"(its unique value in a file) from here onwards i want to search a word "Restarts"(multiple occurences in a file) on the first occurence of result(<add key="Restarts" value="1000" /> ) in that i want to change the value 1000 to 500).
Expected output will be
<properties>
<add key="DeliveryWithinDay" value="False" />
<add key="ABC" value="23:00:00 PM" />
<add key="DEF" value="(GMT-06:00) " />
<add key="CVB" value="90" />
<add key="XCB" value="2" />
<add key="Restarts" value="0" />
</properties>
<properties>
<add key="ContactAddress" value="Home" />
<add key="AttemptInterval" value="10" />
<add key="Restarts" value="500" />
<add key="DEF" value="(GMT-06:00) " />
<add key="CVB" value="90" />
<add key="RestartInterval" value="600" />
</properties>
<properties>
<add key="DeliveryNextDay" value="False" />
<add key="ABC" value="23:00:00 PM" />
<add key="DEF" value="(GMT-06:00) " />
<add key="CVB" value="90" />
<add key="XCB" value="2" />
<add key="Restarts" value="50" />
<add key="XAB" value="2" />
</properties>
Thanks in advance