Floating point exception

AI tells me this is script is correct:

awk -F',' '{s+=$7; n++} END {if(n>0) printf "%.1f", s/n; else print -99}'
 
I have no idea. I use only natural intelligence. Did you test it?

At a cursory reading it seems correct (although it depends greatly on the output). I don't know whether putting two awk statements in the same line is legal though.
 
Back
Top