#awk script to filter output from charmm (using dmap option) #cutoff is the largest distance between two residues you want #considered to be a contact. BEGIN{ counter = 0 } { cutoff = 8.0 if ( $3 <= cutoff && $3 > 0 ){ printf("%4s %4s %7.3f \n",$1,$2,$3) counter++ } } END{ print "##Total number of contacts: "counter/2 }