#! /usr/bin/gawk -f END { print Itime } /^H/ { Time = $2 Diff = Time - Last if (Diff>0 && Diff<=120) Itime += Diff Last = Time }