I believe the best approach to your problem is break it down into two stages.
Stage 1: Read the report and create a Summary which contains totals for each product. Create an export (e.g. an Excel file) of this Summary - say ItemTotals.xls. This export will have two columns: Item and TotalOnHand and based on your example above would look like the following:
Stage 2: Open the report as normal and use an External Lookup to import the Excel file created at Stage 1 (ItemTotals.xls), giving you a TotalQOH field containing the additional data you require.
If you haven't used External Lookups before, they're pretty straightforward - you simply need to link the two sets of data using a Key ( in this case Item) and you can specify which fields you need to import - (here it will be TotalOnHand).
If all of this works as required, it is quite simple to automate the two sub-processes using a batch file or script.
If you need any further help, please feel free to get back to the forum or PM me.