#!/bin/tcsh

foreach a (`ls *.ad`)
	set b = `echo $a | sed 's/_.*//'`
	echo $b $a
	
	mkdir $b; mv ${b}_* $b; cd $b
	ln -s ${b}*ad single-${b}.atom-defs.dat
	ln -s ${b}*rd single-${b}.resi-defs.dat
	ln -s ${b}*con single-${b}.atom-vols.dat
	cd ..
end
