BEGIN{ now=strftime("%FT%H",systime()); found=0; n=0; } { split($1,b,"[:]"); if(b[1]==now) { T=$4*10 HW=$5 Price=$2*100; found=1; } if(found) n++; } END{ if(!found) print -1; else print T, HW, Price, n; }