while [ $COUNTER -lt $LINECOUNT ]; do searchpattern=$( head -n$COUNTER $STATFILE | tail -n1) #echo $searchpattern date=$( grep "$searchpattern" $STATFILE | awk '{print $1}') inbytes=$( grep "$searchpattern" $STATFILE | awk '{print $2}') outbytes=$( grep "$searchpattern" $STATFILE | awk '{print $3}') # totalsin=$( grep Totals $TOTALFILE | awk '{print $2}') # totalsout=$( grep Totals $TOTALFILE | awk '{print $3}') #inbytes=$( grep $NEWDATE $TOTALFILE | awk '{if (int($1)!=0) print $2}') #outbytes=$( grep $NEWDATE $TOTALFILE | awk '{if (int($1)!=0) print $3}') echo -n "($date) " convert $inbytes convert $outbytes echo let COUNTER=COUNTER+1 done