1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Free Software Foundation, Inc.
Copyright (C) 2013-2021 Assaf Gordon <assafgordon@gmail.com>
Copyright (C) 2022-2025 Timothy Rice <trice@posteo.net>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
GNU Datamash
============
GNU Datamash is a command-line program which performs basic
numeric,textual and statistical operations on input textual data files.
it is designed to be portable and reliable, and aid researchers
to easily automate analysis pipelines, without writing code or even
short scripts.
Home page: https://www.gnu.org/software/datamash
Usage
=====
See `datamash --help` for basic usage information.
See `man datamash` for examples and operation details.
For the instrucions manual, see `info datamash` or visit
https://www.gnu.org/software/datamash/manual/
Examples
========
What's the sum and mean of the values in field 1 ?
$ seq 10 | datamash sum 1 mean 1
55 5.5
Given a file with three columns (Name, College Major, Score),
what is the average, grouped by college major?
$ cat scores.txt
John Life-Sciences 91
Dilan Health-Medicine 84
Nathaniel Arts 88
Antonio Engineering 56
Kerris Business 82
...
# Sort input and group by column 2, calculate average on column 3:
$ datamash --sort --group 2 mean 3 < scores.txt
Arts 68.9474
Business 87.3636
Health-Medicine 90.6154
Social-Sciences 60.2667
Life-Sciences 55.3333
Engineering 66.5385
See more examples at https://www.gnu.org/software/datamash/examples/
Download and Installation
=========================
Download the latest source code at https://www.gnu.org/software/datamash .
General installation commands:
$ tar -xzf datamash-[VERSION].tar.gz
$ cd datamash-[VERSION]
$ ./configure
$ make
$ make check
$ sudo make install
Also see INSTALL.
See Platform/OS-specific download instructions at
https://www.gnu.org/software/datamash/download/
To build from latest git sources, see the HACKING.md file. This file is
available when cloning from git, but is not distributed in the tar archive.
To clone the git repository run
git clone git://git.savannah.gnu.org/datamash.git
It is also available online at
https://git.savannah.gnu.org/cgit/datamash.git/tree/HACKING.md
BASH Auto-completion
====================
The datamash package inclueds a bash auto-completion script.
The installation location can be controlled using
./configure --with-bash-completion-dir=[no|local|global|PATH]
The options are:
* local - install under the package's $PREFIX path.
typically `/usr/local/share/datamash/bash-completion.d/` ,
but can be changed with `./configure --prefix`.
This is the default.
* no - do not install the bash completion script.
* [PATH] - install into the PATH specified on the command line, e.g.
`./configure --with-bash-completion-dir=/for/bar/bash-completion.d/`
* global - install into the system's global bash-completion directory,
as reported by `pkg-config`. This will be the result of:
`pkg-config --variable=completionsdir bash-completion`
Which is commonly `/usr/share/bash-completion/completions`
or `/etc/bash.d`.
If `pkg-config` is not found or if `pkg-config` does not have
the config (.pc) file for the bash-completion package,
defaults to 'local'.
`local` is the default, and should be used particularly if installing under
a non-default `--prefix` without root permissions.
`global` should be used if you are installing to default location (/usr/local)
and have root permissions (e.g. `sudo make install`).
Using custom PATH or `global` should be used when packaging datamash for
further distribution.
Questions and Bug Reports
=========================
- Please send questions and bug reports to bug-datamash@gnu.org .
- Searchable archive at https://lists.gnu.org/archive/html/bug-datamash .
- Subscribe at https://lists.gnu.org/mailman/listinfo/bug-datamash .
Copyright and License
=====================
Copyright (C) 2013-2021 Assaf Gordon <assafgordon@gmail.com>
License: GPL Version 3 (or later). See COPYING.
For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.
|