{
cat tmp/A1
appl/sh/fdav1 " "
} |
awk -F"^" ' BEGIN {h=0;d=0;xx=47}
NR==1 {
for (i=1;i<NF+1;i++) x[$i]=i 
next }
$1!=ant{
	if (ant!="" )
	{
	printf "H44%s\n",can >File
		 print "\n" >File
		close(File)
	}
	ant=$1
	File="tmp/REG."sprintf("%.3d",h++)
	for (i=0;i<xx; i++) if(x[i]!="") printf "H%.2d%s\n",i,$x[i] >File
dd=0
}
$1==ant && $30 !="" { 
	printf "D%.2d00%s\n",dd,$30 >File
	printf "D%.2d01%s\n",dd,$31 >File
	printf "D%.2d02%s\n",dd,$32 >File
	printf "D%.2d03%s\n",dd,$33 >File
	printf "D%.2d04%s\n",dd++,$34 >File
	can=$30
 }

'  -
