Article 4WBQF How to delete all lines from XML file with specific pattern

How to delete all lines from XML file with specific pattern

by
masood_11
from LinuxQuestions.org on (#4WBQF)
I had one XML file in which I want to delete all lines which lies between pattern and within that pattern one specific word is found. From XML file entries I want to delete all lines where a word osb is found within element <configProperty> and </configProperty>.

Any help is appreciated.

<?xml version="1.0" encoding="UTF-8"?><!--
Use this move plan to change the endpoint configuration for the
production environment.
Move Plan Modification TIPS:
1> DO NOT MAKE AN ADDITION TO THE MOVE PLAN. ONLY EDIT IT.
2> Every "configProperty" has an "itemMetadata" associated with it.
3> Element "itemMetadata" defines the type of value of the "configProperty".
4> Do not Edit "configProperty" of the type "READ_ONLY". This may lead to
an error during the T2P tool execution.
5> The value of the configProperty of the "ItemMetadata" type "password" must be
the absolute location of a file containing the password
for the property.
It is recommended to restrict access to this file using OS permissions,
ensuring that the user running the T2P process has read permission on it.
--><movePlan>
<movableComponent>
<componentType>OHS</componentType>
<componentName>EBS_web_EBSDEV1</componentName>
<version>11.1.1.9.0</version>
<id>CLONE20190530235604297</id>
<moveDescriptor>
<configGroup>
<type>mod_wl_ohs.conf</type>
<configProperty>
<name>IfModule</name>
<value>mod_weblogic.c</value>
<itemMetadata>
<dataType>STRING</dataType>
<scope>READ_ONLY</scope>
</itemMetadata>
<configProperty>
<name>Location</name>
<value>/OA_HTML</value>
<itemMetadata>
<dataType>STRING</dataType>
<scope>READ_ONLY</scope>
</itemMetadata>
<configProperty>
<name>WebLogicCluster</name> <value>servername.com:xxxx,servername.com:xxxx</value>
<itemMetadata>
<dataType>STRING</dataType>
<scope>READ_WRITE</scope>
</itemMetadata>
</configProperty>
</configProperty>
<configProperty>
<name>Location</name>
<value>/osb</value>
<itemMetadata>
<dataType>STRING</dataType>
<scope>READ_ONLY</scope>
</itemMetadata>
<configProperty>
<name>WebLogicCluster</name> <value>servername.com:xxxx,servername.com:xxxx</value>
<itemMetadata>
<dataType>STRING</dataType>
<scope>READ_WRITE</scope>
</itemMetadata>
</configProperty>
</configProperty>
</configGroup>
</moveDescriptor>
</movableComponent>
</movePlan>latest?d=yIl2AUoC8zA latest?i=udw_-P5B0gU:FZLBHAok8hI:F7zBnMy latest?i=udw_-P5B0gU:FZLBHAok8hI:V_sGLiP latest?d=qj6IDK7rITs latest?i=udw_-P5B0gU:FZLBHAok8hI:gIN9vFwudw_-P5B0gU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments