I am having some trouble with an awk programme that i have co-written that scans my WUFI ascii output file.
This is partly a problem with me not writing the perfect awk programm, partly because i'm doing it in terminal/darwin on my mac and also because the WUFI ascii outputs are so 'dirty' (sorry)
my ascii columns are as follows:
1: ref, 2: ext air temp, 3: temp at monitor position 2, :4 water content
I am using the awk to pick up a freezing event at monitor position 2, so from + to - figures and to tell me when this coincides with a water content over 208kg/m3
the awk prints all the zero crossing events with their water content, not just the ones over 208. (there is one that i put in to test)
I have pasted the awk file below, not sure how to paste a sample of an ascii output? This apparently runs perfectly on a PC so it may be a mac problem.
Any help would be appreciated
Dan
frost.awk:
{
gsub(/E\+000/,"e"); gsub(/E\-000/,"e-") # gets rid of excess zeros, note \ is to define "+" as a charcater not an action
#print $0
if (TOld>=0 && $3<0 && $4>208) print int($1/1),$3/1,$4/1 # checks if temperature drops below zero and prints ref, temp and water
TOld=$3 # resets temperature
}

