for i in `ls`
do

cd $BDA/anon/$i

if test -f idam.id1.Z || test -f idam.id1
then
zex idam.id1 | awkg 12 6 272000 | awk ' { print $1, $2 } ' > .T/no.lst
fi

net=0
test -f .T/no.lst && net=`cat .T/no.lst | wc -l`

if test $net -eq 0
then
  echo "Anon $i: Pas de HD Extension" >> $BDA/gestion/sans.hde
else
  if test -f spt.don.Z || test -f spt.don
  then
  zex spt.don | join -j2 1 -a2 -o 2.1 2.2 1.2 1.3 - .T/no.lst | \
  awk ' {printf" %04d  %6d  %2s  %3s\n",$1,$2,$3,$4 } ' > $BDA/hde/$i.hde
  sort -n +1 -o $BDA/hde/$i.hde $BDA/hde/$i.hde
  echo anon/$i $net >> $BDA/gestion/spt.hde
  rm .T/no.lst
  fi
fi

done
