zcat db.Z | grep "^Total:" | awk '{print $2}' | accumulate(assuming a suitable definition of accumulate).
Unix has an impoverished data-model (lines of text), but even so this method of interoperability is very powerful. Similar techniques are next to impossible in current windowing systems.