I have few very large(10GB) xml files, with the following structure. As you can see the file contains series of records. what i would like to do is search record based on one or multiple properties. The problem is that a simple grep would give me the line containing the property. So for example, grep might give me a line 100, line 300 and so on. But, i require is the capability to extract the relevant record element, not just the lines that met the match. Are there any unix utilities that can help?
<records>
<record seq="1">
<properties>
<property name="AssetId">1234</property>
</properties>
<message>messsage1</message>
</record>
<record seq="2">
<properties>
<property name="VI-ID">4567</property>
</properties>
<message>message2</message>
</record>
<records>