Skip to content

Commit

Permalink
datamash: add page (tldr-pages#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaggioni authored and agnivade committed May 2, 2018
1 parent 057c8bf commit 4033673
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pages/linux/datamash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# datamash

> Tool to perform basic numeric, textual and statistical operations on input textual data files.
- Get max, min, mean and median of a single column of numbers:

`seq 3 | datamash max 1 min 1 mean 1 median 1`

- Get the mean of a single column of float numbers (floats must use "," and not "."):

`echo -e '1.0\n2.5\n3.1\n4.3\n5.6\n5.7' | tr '.' ',' | datamash mean 1`

- Get the mean of a single column of numbers with a given decimal precision:

`echo -e '1\n2\n3\n4\n5\n5' | datamash -R {{number_of_decimals_wanted}} mean 1`

- Get the mean of a single column of numbers ignoring "Na" and "NaN" (literal) strings:

`echo -e '1\n2\nNa\n3\nNaN' | datamash --narm mean 1`

0 comments on commit 4033673

Please sign in to comment.