#!/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 multi-${b}.atom-defs.dat
	ln -s ${b}*rd multi-${b}.resi-defs.dat
	ln -s ${b}*con multi-${b}.atom-vols.dat
	cd ..
end
