# if points=="all", use all points, otherwise only converged ones (i.e. if $6 <= 1e-9)
{ ignore=0 }
# recognize "# xname = xvalue" pattern
/^#/ && NF == 4 && $3 == "=" { printf("# %s ", $2); out = $4 }
# ignore comments and error messages
/^#/ { ignore=1 }
/^LCBP::run:  initial _pancakes has NaNs!/ { ignore=1 }
/^HAK::doGBP:  Qb_new has NaNs!/ { ignore=1 }
# first line has only two fields
NF == 2 && ignore == 0 { printf( "t%s ",$1); out = out " " $2 } 
# new syntax
NF == 6 && ignore == 0 { printf( "t%s me%s ae%s md%s z%s c%s ", $1, $1, $1, $1, $1, $1); 
                         if( $2 == 0 )
                             out = out " .1 ";
                         else
                             out = out " " $2 " ";
                         if( ($6<=1e-9 || points=="all") && !($3 == "nan") )
                             out = out $3 " " $4 " " (($5<0)?(-$5):$5); 
                         else 
                             out = out "NAN NAN NAN"; 
                         out = out " " $6 " " exp($6 <= 1e-9);}
END { printf( "\n%s\n", out) }
