Introduction
Introduction Statistics Contact Development Disclaimer Help
tadd sum(1) - numtools - perform numerical operations on vectors and matrices i…
git clone git://src.adamsgaard.dk/numtools
Log
Files
Refs
README
LICENSE
---
commit 0f2c23d56a45a8cb29f973c8e551a291321bb796
parent d56b66df11a431c8d96450504bced09cfc1be98c
Author: Anders Damsgaard <[email protected]>
Date: Wed, 9 Dec 2020 11:18:22 +0100
add sum(1)
Diffstat:
A sum | 13 +++++++++++++
A sum.1 | 25 +++++++++++++++++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/sum b/sum
t@@ -0,0 +1,13 @@
+#!/usr/bin/awk -f
+{
+ for (i = 0; i < NF; i++)
+ sum[i] = $i
+}
+END {
+ for (i = 0; i < NF; i++) {
+ printf("%g", sum[i])
+ if (i + 1 < NF)
+ printf("\t")
+ }
+ printf("\n")
+}
diff --git a/sum.1 b/sum.1
t@@ -0,0 +1,25 @@
+.Dd $Mdocdate$
+.Dt SUM 1
+.Os
+.Sh NAME
+.Nm sum
+.Nd returns the sum for each column
+.Sh SYNOPSIS
+.Nm
+.Op Ar file
+.Sh DESCRIPTION
+The
+.Nm
+returns the numerical sum for each column in
+.Ar file
+or in standard input, if no
+.Ar file
+is given.
+Input fields must be tab-separated.
+.Sh SEE ALSO
+.Xr awk 1
+.Xr max 1
+.Xr mean 1
+.Xr min 1
+.Sh AUTHORS
+.An Anders Damsgaard Aq Mt [email protected]
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.