#!/bin/sh #makes a .seq file from a pdb file #first awk script counts the number of residues and prints header awk 'BEGIN{ counter = 0 } { if ($3 == "CA"){ counter++ pdb_code = $11 } } END{ print "* sequence for "pdb_code print "*" print counter }' $1 #second awk script prints sequence awk '{ if ($3 == "CA"){ print $4 } }' $1