read specific lines from a file using python
<p>I have a file with data like:</p>

<pre><code>   1xxy
   (1gmh)

[white line]
ahdkfkbbmhkkkkkyllllkkjdttyshhaggdtdyrrrutituy
[white line]  
   __________________________________________________
   Intra Chain:
   A 32
   __________________________________________________
   PAIR 1MNS HE 10 NM A ARG 33 OX1 3.22 32
   PAIR 1MNS UR 11 NM A ARG 33 OX2 3.21 12
   PAIR IMNS UK 32 NH A ASN 43 OZ1 5.21 22
   ...
   __________________________________________________
</code></pre>

<p>NOW i want to make it like:</p>

<pre><code>   PAIR 1MNS HE 10 NM A ARG 33 OX1 3.22 32
   PAIR 1MNS UR 11 NM A ARG 33 OX2 3.21 12
   PAIR IMNS UK 32 NH A ASN 43 OZ1 5.21 22
   ...
</code></pre>

<p>i.e. remove all other characters.
i tried using:</p>

<pre><code>inp = open('c:/users/rox/desktop/1UMG.out','r')
for line in inp:
    if not line.strip():      # to remove excess whit lines
       continue
    else:
       z = line.strip().replace('\t',' ')
       if z.startswith('PAIR'):
          print z
inp.close()
</code></pre>

<p>but this code is also giving me no output. Can't figure out why <code>z.startswith('PAIR')</code> is not working. But up to the previous line it is going fine.</p>
