thanks for responding. field three is actually in epoch time, but when you run the
"'{$3=strftime("%a %b %d %T %Y,%s",$3)}1' OFS=, "
on it, it translate it into what is shown above.
the
${AWK} "/${MONTH} ${DAY} ${TIMEH}:.*:.*/,0"
is to print all lines it finds under the first line that matches "MONTH DAY TIME". for instance, "Mar 19 18:.*:.*".
my problem is that the number of fields in each line in the datafile changes depending on a number.
so while the awk is printing all lines it finds under "Mar 19 18:", i want it to also run condition check. so for each line, i want to do something like this: "if field 9 of this line i'm currently reading is greater than 11", then print this, else, print this." this is where i get lost.
Since the expressions are evaluated in a boolean context, the 0 will never trigger a match. So the quoted code means that once the regular expression matches, its actions will be applied to the line that matched the regexp and all subsequent lines.