title: How to read negative numbers from a file?
body: <p>I have a file that contains strings like this :</p>
  
  <blockquote>
    <p>N7300 <strong>X-7.254 Y-40.839 A-89.74</strong></p>
    
    <p>N7301 <strong>X-7.002 Y-40.847 A-89.806</strong> </p>
    
    <p>N7302 <strong>X-6.75 Y-40.855 A-89.873</strong> </p>
    
    <p>N7303 <strong>X-6.511 Y-40.862 A-89.926</strong> </p>
    
    <p>N7304 <strong>X-6.272 Y-40.868 A-89.979</strong></p>
  </blockquote>
  
  <p>The bold strings has negative numbers. I dont know how to read these numbers from the file.</p>
  
  <p>I want to generate output like this :</p>
  
  <blockquote>
    <p><strong>[('N','7300'),('X','-7.254'), ('Y','-40.839')  . . .]</strong></p>
  </blockquote>
  
  <pre><code>import re
  import sys
  with open(r'/home/ruchir/Desktop/NewFolder/TEST.txt') as f:
      lines=f.readlines()
      lines=''.join(lines)
      lines=lines.split()
      a=[]
  
      for i in lines:
          match=re.match(r"([a-z]+)([0-9]*\.?[0-9]+)",i,re.I)
          if match:
              a.append(match.groups())
              print a
  </code></pre>
  
  <p>I wrote this program that works fine but not for negative integers..!!
  Plzz help me, I'm new in Python...</p>