Gurus,
I need to run a script on multiple XML files in different directories and do the following (the output can be redirected to create a new file)
- Search a pattern like "abc.mno.xyz" in an XML file, once detected, the script should delete one line above and 3 lines below (including the line containing the pattern)
So the following pattern should just disappear from the text file on which I will run this script
<option>
<name>abc.mno.xyz</name>
<value>true</value>
</option>
-
Update the following fragment in the XML file
<options> <option> <name>addAllRoles</name> <value>true</value> </option> </options>
to the following (it changes one of the value from true to false and adds an additional xml tag)
<options>
<option>
<name>addAllRoles</name>
<value>false</value>
</option>
<option>
<name>addRoles</name>
<value>false</value>
</option>
</options>