计算具有相同字符串的相似行的总和

时间:2015-09-22 19:17:19

标签: awk

如何合并第1列中相同的行,然后获取第2列中相似行的值的总和?我尝试了不同的awk,但不确定如何得到正确的总和。

__too_low_aQual 3
mir-10  5
Y_RNA   4
__too_low_aQual 0
__too_low_aQual 0
__not_aligned   1
mir-8   2
mir-671 3
mir-671 16
mir-671 2
__too_low_aQual 4
SNORD91 3
__not_aligned   7
mir-10  104
__too_low_aQual 6
__no_feature    1
__too_low_aQual 0
SNORD58 6
__too_low_aQual 4
let-7   2
__not_aligned   0
__not_aligned   1

0 个答案:

没有答案