view master/bin/finalMerge.py @ 36:9d4f130073b8

merge the uploaded results of fixAndMerge
author Henry S. Thompson <ht@markup.co.uk>
date Thu, 29 Nov 2018 13:41:27 +0000
parents
children beae6309d4ec
line wrap: on
line source

#!/usr/bin/env python3
import sys,re
mh={}
ms={}
for l in sys.stdin:
  (h,m,y,c)=l.split()
  if h=='http':
    tab=mh
  else:
    tab=ms
  key='%s\t%s'%(m,y)
  tab[key]=tab.get(key,0)+int(c)
for (l,tab) in zip(['http','https'],[mh,ms]):
  for k in sorted(tab.keys()):
    print(l,k,tab[k],sep='\t')