How to read & count XML records from a file in UNIX shell Script

Viewed 4656

I have records inside the XML tags, and I want to get the count of them. In below, e.g. the contents inside the <record> </record> tag should be counted as 1. So for the example below, the count should be 2:

<record>
    hi
    hello
</record>

<record>
    follow
</record>

Could somebody help me with the Unix Shell Script?

3 Answers
Related