#!/bin/csh -f

if (-e ALLTITLES.html) /bin/rm ALLTITLES.html


./BIBtoTITLE.awksh ALLBIBS.html > ALLTITLES.unsort


cat ALLTITLES.unsort | awk '/<UL>/{ulcnt ++;} {print; if (ulcnt >= 2) exit;}' > ALLTITLES.html
cat ALLTITLES.unsort | awk '/<UL>/{ulcnt ++;next;} /^<LI>/ && (ulcnt >= 2)' | sort -k2,2r -k3 | awk '{print; print "";}' >> ALLTITLES.html

cat ALLTITLES.unsort | awk '/<[/]BODY>/{endit=1;print "</UL><P>"; print "<BR>";print "";print "</P>";print "";} endit==1{print $0;}' >> ALLTITLES.html
 
