Getting the count of unique values in a column in bash

后端 未结 5 895
一整个雨季
一整个雨季 2021-01-30 08:14

I have tab delimited files with several columns. I want to count the frequency of occurrence of the different values in a column for all the files in a folder and sort them in d

5条回答
  •  终归单人心
    2021-01-30 08:23

    Here is a way to do it in the shell:

    FIELD=2
    cut -f $FIELD * | sort| uniq -c |sort -nr
    

    This is the sort of thing bash is great at.

提交回复
热议问题