Skip to content

csvtk v0.2.5

Compare
Choose a tag to compare
@shenwei356 shenwei356 released this 11 Apr 17:29
· 481 commits to master since this release

Changes

- fix bug of `stat` that failed to considerate files with header row
- add subcommand `stat2` - summary of selected number fields
- make the output of `stat` prettier

stat2

Usage

summary of selected number fields: num, sum, min, max, mean, stdev

Usage:
  csvtk stat2 [flags]

Flags:
  -f, --fields string   select only these fields. e.g -f 1,2 or -f columnA,columnB
  -F, --fuzzy-fields    using fuzzy fields, e.g. *name or id123*

Examples

  1. simplest one

    $ seq 1 5 | csvtk stat2 -H -f 1
    field   num   sum   min   max   mean   stdev
    1         5    15     1     5      3    1.58
    
  2. multiple fields

    $ cat digitals.tsv
    4       5       6
    1       2       3
    7       8       0
    8       1,000   4
    
    $ cat digitals.tsv | csvtk stat2 -t -H -f 1-3
    field   num     sum   min     max     mean    stdev
    1         4      20     1       8        5     3.16
    2         4   1,015     2   1,000   253.75   497.51
    3         4      13     0       6     3.25      2.5