Skip to content

Instantly share code, notes, and snippets.

@gghatano
Created November 23, 2014 13:42
Show Gist options
  • Save gghatano/d73482b40abdf33f7a37 to your computer and use it in GitHub Desktop.
Save gghatano/d73482b40abdf33f7a37 to your computer and use it in GitHub Desktop.
mコマンドで集計の練習
#!/bin/bash
## hit ranking
cat ./batting_data.csv |
mcut f=BAT_ID,H_FL,AB_FL |
mselstr f=AB_FL v=T |
mchgstr f=AB_FL c=T:1 |
mcal c='if(${H_FL}>0, 1, 0)' a=HIT_FL |
mcut f=BAT_ID,HIT_FL,AB_FL |
msum k=BAT_ID f=HIT_FL:HIT,AB_FL:ATBAT |
mselnum f=ATBAT c='[1,]' |
mcal c='${HIT}/${ATBAT}' a=AVG |
mselnum f=ATBAT c='[4000,]' |
msortf f=AVG%nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment