Combine results of column one Then sum column 2 to list total for each entry in column one

前端 未结 3 1115
失恋的感觉
失恋的感觉 2021-01-14 08:13

I am bit of Bash newbie, so please bear with me here.

I have a text file dumped by another software (that I have no control over) listing each user with number of ti

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 08:47

    GNU datamash:

    datamash -W -s -g1 sum 2 < input.txt
    

    Output:

    Bob 219
    Jim 245
    John    208
    Mark    190
    Richard 142
    Sean    201
    

提交回复
热议问题