diff options
| author | wukong <wukong@longaeva> | 2018-06-18 04:00:29 -0700 |
|---|---|---|
| committer | wukong <wukong@longaeva> | 2018-06-18 04:00:29 -0700 |
| commit | c44ac59acbb18c6982e180637566dec8eb9baebd (patch) | |
| tree | 66ea1e51ed0a60b2fdf48ea1b1c5b852007a05fd /sum4.awk | |
| parent | 2482727a6902e44e6a68236f878f5f9bf7947bd2 (diff) | |
adjusted print statements to use OFMT, OFS, and ORS;
Diffstat (limited to 'sum4.awk')
| -rw-r--r-- | sum4.awk | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -5,7 +5,7 @@ # output: sums of numeric columns function isnum(n) { - OFMT = "%.18g" + #OFMT = "%.18g" sign = "[+-]?" decimal = "[0-9]+[.]?[0-9]*" fraction = "[.][0-9]+" @@ -31,8 +31,7 @@ NR==1 { END { for (i=1; i<=nf_max; i++) { if (header[i]) - printf("%s: \t", header[i]) - printf("%.18g\n", sum[i]) - printf(i < nf_max ? "" : OFS ) + printf("%s:" OFS, header[i]) + printf(OFMT ORS, sum[i]) } } |
