Hi,
There is tracemetric (
http://tracemetrics.net/) which is a Java based tool, but it does similar procedures with those you do. In addition it is based on the trace format of ns-3.14 which could potentially have changed, so it would require some updates.
However, you could use trace sources to generate your own trace files for TX/RX packets with simpler format and thus easier RegX. Or simply use those trace sources with the stats module to calculate your metrics within the simulation, not with post-processing.
Further, you could look at FlowMonitor class which can provide such statistics for unicast TCP/UDP traffic.