I have a large XML file that has tens of thousands of the same elements:
<rootElem>
<fizz buzz="true">234</fizz>
<fizz buzz="false">384</fizz>
<fizz buzz="true"></fizz>
<fizz buzz="true">39494</fizz>
<fizz/>
</rootElem>
I'd like to run a grep
that prints out any <fizz>
elements that do not contain text/body data (the numbers in between the opening & closing tags). In the example above, the grep
would produce 2 lines for the 3rd and 5th <fizz>
elements that do not contain the numeric data. The file name is fizzes_20.xml
. I tried running the following but to no avail:
grep fizzes_20.xml "></>"
grep fizzes_20.xml "/>"
Any ideas? Thanks in advance!