summaryrefslogtreecommitdiff
path: root/sum2.awk
diff options
context:
space:
mode:
authorwukong <wukong@longaeva>2026-05-03 13:10:31 -0700
committerwukong <wukong@longaeva>2026-05-03 13:10:31 -0700
commitb60f09401a15721f626bcb7c852f68b82fe39c1c (patch)
tree0fa5ed72ec96c8b0cc83699a0497761c9ec0eed7 /sum2.awk
parente3f9ccd5303c516d2e1c48112d8b52609ce4ad5e (diff)
replaced sum[1-4].awk with serial and columnar versions;
minor merge updates between fir_window scripts;
Diffstat (limited to '')
-rw-r--r--sum2.awk29
1 files changed, 0 insertions, 29 deletions
diff --git a/sum2.awk b/sum2.awk
deleted file mode 100644
index 4fcf3b6..0000000
--- a/sum2.awk
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/awk -f
-
-### sum2.awk, print column sums
-# check that each line has the same number of fields as line one
-
-
-BEGIN {
- OFS = FS
-}
-
-
-NR == 1 {
- for (i=1; i<=NF; i++)
- isnum($i) ? header[i] = "col" i : header[i] = $i
-}
-
-
-NF > 0 {
- (NF > nf_max) ? nf_max = NF : nf_max = nf_max
- for (i=1; i<=NF; i++)
- sum[i] += $i
-}
-
-
-END {
- for (i=1; i<=nf_max; i++)
- printf(OFMT "%s", sum[i], i < nf_max ? OFS : ORS)
-}
-