CCL Home Page
Up Directory CCL name2number.awk
#!/usr/local/bin/nawk -f
# substitute numbers for atom names

# read carfile and generate associative array to map atom names to numbers
function atom_number_array(carfile,array,   nr,offset){
	# read carfile
	nr = 0
	offset = 1
	while ( getline  "
		exit
	}
	atom_number_array(c,numberarray)
}
{
	for ( i=1 ; i<= NF ; ++i ) 
		if ( $i in numberarray )
			$i = numberarray[$i]
	print
}

Modified: Wed Nov 13 17:00:00 1996 GMT
Page accessed 6599 times since Sat Apr 17 21:24:40 1999 GMT