Skip to content

Instantly share code, notes, and snippets.

View butackle's full-sized avatar
🐷
happy

ぷる butackle

🐷
happy
  • Japan
View GitHub Profile
@butackle
butackle / shellGei_20160618_memo.sh
Created June 18, 2016 07:56
2016/6/18のシェル芸勉強会の雑メモ
sed 's/.. / /' monthly_typhoon | sm2 1 1 2 2 | paste - <(tail -n +2 landing.csv ) | sed 's/,$/,0/' | tr , ' ' | awk '$1!=$3 || $2!=$NF
sed 1d landing.csv | awk -F, '{for(i=1;i<=12;i++){a[i]+=$(i+1)}}END{for(k in a){print k" " a[k]"/"NR"="a[k]/NR }}' | sort -n
sed 1d landing.csv | awk -F, '{for(i=1;i<=12;i++){if(i==1 || $i != ""){printf $i;if(i>1){printf ":";print $i;break}}}}'
awk -F, '{for(i=2;i<=13;i++){if($i>0){print $1,i; next}}}' landing.csv
cat monthly_typhoon | grep -v ' 0$' | less | guniq -w4 | sed 's/....//' | awk '{print $1}' | sort | uniq -c