Count items in a long XML file
Want to count items within an XML structure like the one below ?
<root>
<item_tag>....</item_tag>
<!--maybe thousands of items here-->
</root>
Here's a simple line command to do that
cd directory
grep "<item_tag>" filename.xml | wc -l
This will output the exact number of items within your XML structure
Written by Andy Kifer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Command line
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#