Skip to content

Instantly share code, notes, and snippets.

View livc's full-sized avatar
🙉
Meditation

Armin Li livc

🙉
Meditation
View GitHub Profile
@livc
livc / awk_common_usage
Last active February 3, 2017 13:30
`awk` common usage
// vim: syntax=bash
awk -F"\t" '{if(NR==FNR){dict[$4]=1}else{if(!($1 in dict)){print}}}' reskey_cuid.mup ./20161122 > 2333333
awk substr(s, a, b)
awk '{print substr($0,2,6)}' file
cat ../../../navi_id_dict |awk -F "\t" 'dict[$1]=$2''{print $1}'
cat 20161019 |awk -F":" '{dict[$1]+=$2}END{for (x in dict){printf("%s,%d,%.2f%s\n", x, dict[x], 100*dict[x]/dict["Tag 1"], "%")}}' | sort -t "," -k2nr > 20161019sum