I am writting a shell script to delete an entry from a specific group.
eg: file name is dest.xml
<domain id="1" group_name="group1">
<node id="ABC">
<node id="PQR">
<node id="XYZ">
</domain>
<domain id="2" group_name="group2">
<node id="PQR">
<node id="XYZ">
</domain>
<domain id="3" group_name="group3">
<node id="ABC">
<node id="PQR">
</domain>
I want to delete an entry from above file (filename is dest.xml) with node id="PQR" from group_name="group1" (it should not get deleted from group2 and group3).
I can do it by reading a file sequentially n then delete it from a specific group. But if the file is to large (>10k lines) then it takes time.
Is there any simple way to this this?
