From c44ac59acbb18c6982e180637566dec8eb9baebd Mon Sep 17 00:00:00 2001 From: wukong Date: Mon, 18 Jun 2018 04:00:29 -0700 Subject: adjusted print statements to use OFMT, OFS, and ORS; --- lin_reg2.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lin_reg2.awk') diff --git a/lin_reg2.awk b/lin_reg2.awk index 7c00fe8..ef0fe57 100644 --- a/lin_reg2.awk +++ b/lin_reg2.awk @@ -4,7 +4,7 @@ # simple linear regression between columns BEGIN { - OFMT = "%.18g" + OFMT = "%.8g" sign = "[+-]?" decimal = "[0-9]+[.]?[0-9]*" fraction = "[.][0-9]*" @@ -82,7 +82,7 @@ END { for (y=1; y<=nf_max; y++) { for (x=1; x<=nf_max; x++) { if (x != y && r[x,y]) { - printf("\n %.18g \t (%s) \t = (%.18g +/- %.18g)(%s) \t + (%.18g +/- %.18g)", + printf(OFMT OFS "(%s)" OFS " = (" OFMT " +/- " OFMT ")(%s)" OFS " + (" OFMT " +/- " OFMT ")" ORS, 10.0*log(r[x,y]*r[x,y])/log(10), header[y], b[x,y], b_err[x,y], header[x], a[x,y], a_err[x,y]) } -- cgit v1.2.3