I tried searching the forums, but couldn't find anything relevant to my question.
I have an xml file like the following:
<topLevel numberBlock="BLOCK1">
<item="content1" title="Content 1">
<RefPath="path/to/file1.txt />
</item>
<item"content2" title="Content 2" >
<RefPath="path/to/file2.txt" />
</item>
</topLevel>
I want to grab the data only found in "BLOCK1". Specifically, I want the the "item" and "RefPath".
So the output would look like this:
<item="content1" title="Content 1">
<RefPath="path/to/file1.txt />
<item="content2" title="Content 2" >
<RefPath="path/to/file2.txt" />
I tried the following code, but it gives me additional RefPaths after BLOCK1 (there are numerous blocks:
grep -E 'item="content | RefPath' inputfile.xml