Dear Justin<br><br>thanks for your reply.<br><br>I did what you said as follows:<br><br>your main script=<br><br># Open up the structure file and work with it
<br>print &quot;Processing coordinate file...\n&quot;;
<br>foreach $_ (@coord) {
<br>     my @line = split(&quot; &quot;, $_);
<br>     my $natom = $line[1];
<br>     my $name = $line[2];
<br>     my $resn = $line[3];
<br>     my $resnum = $line[4];
<br>151
<br>152     if ($line[0] =~ /ATOM/) {
<br>153        <span style="color: rgb(255, 0, 0);"> unless ($resn =~ /SOL/) {</span>
<br>154             for (my $z=1; $z&lt;=$nres; $z++) {
<br>155                 if ($donors{$z} == $natom) {
<br>156                     $donor_names[$z] = $name;
<br>157                     $donor_resn[$z] = join(&#39;&#39;, $resn, $resnum);
<br>158                 } elsif ($acceptors{$z} == $natom) {
<br>159                     $acceptor_names[$z] = $name;
<br>160                     $acceptor_resn[$z] = join(&#39;&#39;, $resn, $resnum);
<br>161              <span style="color: rgb(255, 102, 0);">}
</span><br>             }
<br>         }
<br>     }
<br>}
<br> <br># open a single output file for writing<br><br> <br>my modified script=<br><br># Open up the structure file and work with it
<br>print &quot;Processing coordinate file...\n&quot;;
<br>foreach $_ (@coord) {
<br>     my @line = split(&quot; &quot;, $_);
<br>     my $natom = $line[1];
<br>     my $name = $line[2];
<br>     my $resn = $line[3];
<br>     my $resnum = $line[4];
<br> <br>     if ($line[0] =~ /ATOM/) {
<br>                      for (my $z=1; $z&lt;=$nres; $z++) {
<br>                 if ($donors{$z} == $natom) {
<br>                     $donor_names[$z] = $name;
<br>                     $donor_resn[$z] = join(&#39;&#39;, $resn, $resnum);
<br>                 } elsif ($acceptors{$z} == $natom) {
<br>                     $acceptor_names[$z] = $name;
<br>                     $acceptor_resn[$z] = join(&#39;&#39;, $resn, $resnum);
<br>                }
<br>         }
<br>     }
<br>}
<br> <br># open a single output file for writing<br><br clear="all">is my manner true?<br>when I used modified script, problem was not solved. and output file is as follows:<br><br>#    Donor                    Acceptor                % Exist.<br>
                                                             0.160<br>      NGL1             N                                        0.400<br>     ARG58           NH2                                    43.565<br>     ARG58           NH2                                     1.839<br>
     ARG58           NH1                                     0.080<br>     ARG58           NH1                                     21.663<br>     ARG58           NH1                                     0.160<br>     ARG58            NE                                      1.359<br>
. <br>.<br>.<br>.<br>                                          GLY3             O         1.759<br>                                          GLY4             O         0.400<br>                                         THR47             O        61.711<br>
                                         ASN51           OD1        16.867<br>                                         ASN51           ND2         0.320<br>                                        GLN23           OE1        11.191<br>
.<br>.<br>.<br><br>how to fix it?<br>-- <br><pre style="font-family: arial,helvetica,sans-serif;">Leila Karami<br>Ph.D. student of Physical Chemistry<br>K.N. Toosi University of Technology<br>Theoretical Physical Chemistry Group</pre>
<br>