title: Skipping lines and splitting them into columns in python text parser
body: <p>I am attempting to parse a space delimited text file in python 2.7.5 which looks kind of like:</p>
  
  <pre><code>variable         description      useless data
  a1                asdfsdf           2342354 
              Sometimes it goes into further detail about the 
              variable/description here
  a2                asdsfda           32123
  </code></pre>
  
  <p>EDIT:Sorry about the spaces added in the beginning, i did not see them</p>
  
  <p>I want to be able to split the text file into an array with variable and description in 2 separate columns, and cut all the useless data and skip any lines that do not start with a string. The way I have set up my code to start is:</p>
  
  <pre><code>import os
  import pandas
  import numpy
  os.chdir('C:\folderwithfiles')
  f = open('Myfile.txt', 'r')
  lines = f.readlines()
  for line in lines:
      if not line.strip():
          continue
      else:
          print(line)
  print(lines)
  </code></pre>
  
  <p>As of right now, this code skips most of the descriptive lines between variable lines, however some still pop up in the parsing. If I could get any help with either troubleshooting my line skips or help me to get started on the column forming part that would be great! I also do not have a lot of expirience in python. Thanks!</p>
  
  <p>EDIT: A part of the file before code</p>
  
  <pre><code>CASEID            (id) Case Identification                   1   15   AN
  
  
  
  MIDX              (id) Index to Birth History                16   1  No
                             1:6 
  </code></pre>
  
  <p>After:</p>
  
  <pre><code>CASEID            (id) Case Identification                   1   15   AN
  
  MIDX              (id) Index to Birth History                16   1  No
                             1:6  
  </code></pre>