shell统计重复次数

来源:互联网 发布:eclipse查看源码插件 编辑:程序博客网 时间:2024/05/29 10:01

(1)

awk -F, '{a[$2]++}END{for (i in a) print i" "a[i]}'   文件名.txt




(2)

cat 文件名.txt |cut -d, -f2 |sort |uniq -c |sort -n

0 0
原创粉丝点击