ihmq regiones h00^ d01^ |sort | awk -F^ ' function trail(txt) { while (substr(txt,length(txt),1)==" ") txt=substr(txt,1,length(txt)-1); return (txt) }
{
cm[$1]++
comn[$1""cm[$1]-1]=trail($2)
}
END {
print "var cm=new Array()"
print "var comn=new Array()"
for (i in cm)
{
	printf "cm[\"%s\"]=%d\n",i,cm[i]
	for(j=0;j<cm[i];j++) printf "comn[\"%s%d\"]=\"%s\"\n",i,j,comn[i""j]
} 
} ' > ../js/comunas.js

