cndxv=/tmp/cndxv
ihdm cndxv h00"^" h01"^" h02 > $cndxv

# |  1 H00 codigo 02 00   0 | 2 H01 identi 06 00   2 | 3 H02 descri 256 00   8 |
awk -F"^" ' BEGIN { print "var cdx = new Array()" }
{ cdx[$1]=trail($3) }
function trail(txt) { while (substr(txt,length(txt),1)==" ") txt=substr(txt,1,length(txt)-1); return (txt) }
END {
	for ( i in cdx) printf "cdx[\"%s\"]=\"%s\"\n",i,cdx[i]

}
' $cndxv >../js/cndx.js


