	program splitsville
c
c	program to split up big multi-star orbit file
c	into individual star files
c
	character*80 data
	character*10 wds,test
	character*1 dd1,dd2,dd3,dd4,dd5,dd6,dd7,uc(26),lc(26)
	character*20 outfile
	data uc/'A','B','C','D','E','F','G','H','I','J','K',
     $          'L','M','N','O','P','Q','R','S','T','U','V',
     $          'W','X','Y','Z'/
	data lc/'a','b','c','d','e','f','g','h','i','j','k',
     $          'l','m','n','o','p','q','r','s','t','u','v',
     $          'w','x','y','z'/
c
	open(10,file='orbits.5',status='UNKNOWN')
c
  100	read(10,901,end=999) data,wds
  901	format(a80,t1,a10)
  	outfile='wds'//wds//'.dat'
c
c  100	read(10,901,end=999) data,dd1,dd2,dd3,dd4,dd5,dd6,dd7
c  901	format(a80,t11,7a1)
c	do 150 n=1,26
c	if (dd1 .eq. uc(n)) dd1=lc(n)
c	if (dd2 .eq. uc(n)) dd2=lc(n)
c	if (dd3 .eq. uc(n)) dd3=lc(n)
c 150	continue	
c	if (dd2 .eq. ' ') dd2='_'
c	if (dd3 .eq. ' ') dd3='_'
c	if (dd4 .eq. ' ') dd4='0'
c	if (dd5 .eq. ' ') dd5='0'
c	if (dd6 .eq. ' ') dd6='0'
c	if (dd7 .eq. ' ') dd7='0'
c  	outfile=dd1//dd2//dd3//dd4//dd5//dd6//dd7//'.dat'
c	write(6,902) outfile
c  902	format(a17)
	open(11,file=outfile,status='UNKNOWN')
c
	write(11,903) data
  200	read(10,903,end=999) data,test
  903	format(a80,t1,a10)
  	if (test .eq. '          ') go to 300
	write(11,903) data
	go to 200
  300	close(11)
	go to 100
c
  999	stop
  	end
  	
