#!/sw/bin/gawk -f BEGIN{ FS=":"; fc=0; printf "value-pair"; } FNR==1{ fl[fc++]=FILENAME; printf ":"FILENAME; } { fl[FILENAME]++; histc[$1,FILENAME]=$2; hists[$1]+=$2; } END{ printf "\n" for(i in hists){ printf i; for(j=0; j