for {set a 1} {$a < 10} {incr a} { mol new A000${a}.pdb set temp [atomselect top "(resid 68 to 77) or resid 105 107 127" ] $temp writepdb $a.pdb unset temp mol delete all } unset a for {set a 10} {$a < 100} {incr a} { mol new A00${a}.pdb set temp [atomselect top "(resid 68 to 77) or resid 105 107 127" ] $temp writepdb $a.pdb unset temp mol delete all } unset a mol new A0100.pdb set temp [atomselect top "(resid 68 to 77) or resid 105 107 127" ] $temp writepdb 100.pdb unset temp mol delete all