diff options
| author | wukong <wukong@longaeva> | 2026-04-10 23:46:12 -0700 |
|---|---|---|
| committer | wukong <wukong@longaeva> | 2026-04-10 23:46:12 -0700 |
| commit | 4c4eb1bd8f003b3b57707badd2dd089ed193a896 (patch) | |
| tree | 15b62907fffd70c46a9b4369df93ab33c6aa88ac /sum4.awk | |
| parent | e7d1781578e846a7b1d634cd43c8fab00a67b883 (diff) | |
renamed fir window generators;
minor edits to whitespace and comments for more consistent style;
Diffstat (limited to '')
| -rw-r--r-- | sum4.awk | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -15,17 +15,19 @@ function isnum(n) { } -BEGIN { OFS = FS } +BEGIN { + OFS = FS +} + NR == 1 { - nf_max = NF for (i=1; i<=NF; i++) isnum($i) ? header[i] = "col" i : header[i] = $i } -{ - if (NF > nf_max) - nf_max = NF + +NF > 0 { + (NF > nf_max) ? nf_max = NF : nf_max = nf_max for (i=1; i<=NF; i++) { if ($i == header[i]) continue @@ -36,6 +38,7 @@ NR == 1 { } } + END { for (i=1; i<=nf_max; i++) { printf((header[i]) ? header[i] OFS : OFS) |
