#!/bin/sh pnum=0 offset=0 IFS=: printf "name\tsize\tpnum\toffset\n" while read size name num do if test x"${size}" = x; then echo "--- END -- OF -- G -- PACKET --" offset= continue fi if test x"${num}" = x; then num=${pnum} fi if test x"${name}" != x; then printf "${name}\t${size}\t${num}\t${offset}\n" fi pnum=`expr ${num} + 1` test "${offset}" && offset=`expr ${offset} + ${size}` done