datamash  1.8
About: GNU datamash is a command-line program which performs basic numeric, textual and statistical operations on input textual data files.
  Fossies Dox: datamash-1.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

No Matches
datamash Documentation

Some Fossies usage hints in advance:

  1. To see the Doxygen generated documentation please click on one of the items in the steelblue colored "quick index" bar above or use the side panel at the left which displays a hierarchical tree-like index structure and is adjustable in width.
  2. If you want to search for something by keyword rather than browse for it you can use the client side search facility (using Javascript and DHTML) that provides live searching, i.e. the search results are presented and adapted as you type in the Search input field at the top right.
  3. Doxygen doesn't incorporate all member files but just a definable subset (basically the main project source code files that are written in a supported language). So to search and browse all member files you may visit the Fossies datamash-1.8.tar.gz contents page and use the Fossies standard member browsing features (also with source code highlighting and additionally with optional code folding).
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:


See `datamash --help` for basic usage information.

See `man datamash` for examples and operation details.

For the instrucions manual, see `info datamash` or visit


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

Download and Installation

Download the latest source code at .

General installation commands:

    $ tar -xzf datamash-[VERSION].tar.gz
    $ cd datamash-[VERSION]
    $ ./configure
    $ make
    $ make check
    $ sudo make install

See Platform/OS-specific download instructions at

To build from latest git sources, see the 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://
It is also available online at

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 .
- Searchable archive at .
- Subscribe at .

Copyright and License
Copyright (C) 2013-2021 Assaf Gordon <>

License: GPL Version 3 (or later).

For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.