# HG changeset patch # User Henry S. Thompson # Date 1621965647 14400 # Node ID 870e13483642431dc213f14be332c06e49a4af65 # Parent 2b399c612a3edc92d84cf583d934aafbccd61a5c sum outputs from multiple uniq -c, maybe? diff -r 2b399c612a3e -r 870e13483642 python/sumUC.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/sumUC.py Tue May 25 14:00:47 2021 -0400 @@ -0,0 +1,13 @@ +#!/usr/bin/python +import sys +ss={} +n=0 +for l in sys.stdin: + (count,key)=l.strip().split() + ss[key]=ss.get(key,0)+int(count) + n+=1 +tt=0 +for (key,total) in ss.items(): + tt+=total + print "%s\t%s"%(key,total) +print >>sys.stderr,"%s vs. %s"%(n,tt)