I have an xml file (given below) which lists out installs, changes and removes for each product. The xml also provides totals at the end.
I need to extract the totals (system_change_msg/totals/total_installs, system_change_msg/totals/total_changes and system_change_msg/totals/total_changes) using awk... anybody has any idea on how to do this?
Thanks
Nishant
<system_change_msg
transaction="1"
changed_by="SW$ADMIN"
device_id="0"
object_name="device_counts"
batch="1"
changed_by_timestamp="05/19/2005 01:45:09"
event_type="install">
<product_abc>
<total_installs>13</total_installs>
<total_changes>2</total_changes>
<total_removes>3</total_removes>
</product_abc>
<product_xyz>
<total_installs>4</total_installs>
<total_changes>51</total_changes>
<total_removes>42</total_removes>
</product_xyz>
<product_pqr>
<total_installs>0</total_installs>
<total_changes>300</total_changes>
<total_removes>22</total_removes>
</product_pqr>
<totals>
<total_installs>17</total_installs>
<total_changes>353</total_changes>
<total_removes>67</total_removes>
</totals>
</system_change_msg>
I need to extract the totals (system_change_msg/totals/total_installs, system_change_msg/totals/total_changes and system_change_msg/totals/total_changes) using awk... anybody has any idea on how to do this?
Thanks
Nishant
<system_change_msg
transaction="1"
changed_by="SW$ADMIN"
device_id="0"
object_name="device_counts"
batch="1"
changed_by_timestamp="05/19/2005 01:45:09"
event_type="install">
<product_abc>
<total_installs>13</total_installs>
<total_changes>2</total_changes>
<total_removes>3</total_removes>
</product_abc>
<product_xyz>
<total_installs>4</total_installs>
<total_changes>51</total_changes>
<total_removes>42</total_removes>
</product_xyz>
<product_pqr>
<total_installs>0</total_installs>
<total_changes>300</total_changes>
<total_removes>22</total_removes>
</product_pqr>
<totals>
<total_installs>17</total_installs>
<total_changes>353</total_changes>
<total_removes>67</total_removes>
</totals>
</system_change_msg>