From d1f6c89be163d9399d569e01458242d8ce15e041 Mon Sep 17 00:00:00 2001 From: wukong Date: Sun, 9 Sep 2018 23:48:31 -0700 Subject: added summations to quad_reg added in-progress lpf.awk (low pass filter), an adaptation of convolution script (conv.awk) to use delmitied columns as input additional tweaking of OFMT, OFS, and conditional print statements --- sum1.awk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sum1.awk') diff --git a/sum1.awk b/sum1.awk index 61d96e0..8f1419b 100644 --- a/sum1.awk +++ b/sum1.awk @@ -5,11 +5,13 @@ # output: sum of each column # missing entries are treated as zeros +BEGIN { OFS = FS } + { - for (i=1; i<=NF; i++) - sum[i] += $i if (NF > nf_max) nf_max = NF + for (i=1; i<=NF; i++) + sum[i] += $i } END { @@ -18,3 +20,4 @@ END { printf((i < nf_max) ? OFS : ORS) } } + -- cgit v1.2.3