Skip to main content

GNU DatamashGNU Datamash works pretty well for me.

For example, here is a how to give a groupwise some of the values in column 3 grouped by the values in column 2. There are many other use cases.

$ echo "id,group,value
1,1,2
1,2,1" | datamash -t, --header-in --header-out --sort groupby 2 sum 3

GroupBy(group),sum(value)
1,3
2,1

GNU Datamash works pretty well for me.

For example, here is a how to give a groupwise some of the values in column 3 grouped by the values in column 2. There are many other use cases.

$ echo "id,group,value
1,1,2
1,2,1" | datamash -t, --header-in --header-out --sort groupby 2 sum 3

GroupBy(group),sum(value)
1,3
2,1

GNU Datamash works pretty well for me.

For example, here is a how to give a groupwise some of the values in column 3 grouped by the values in column 2. There are many other use cases.

$ echo "id,group,value
1,1,2
1,2,1" | datamash -t, --header-in --header-out --sort groupby 2 sum 3

GroupBy(group),sum(value)
1,3
2,1
Source Link
cmc
  • 174
  • 1
  • 7

GNU Datamash works pretty well for me.

For example, here is a how to give a groupwise some of the values in column 3 grouped by the values in column 2. There are many other use cases.

$ echo "id,group,value
1,1,2
1,2,1" | datamash -t, --header-in --header-out --sort groupby 2 sum 3

GroupBy(group),sum(value)
1,3
2,1