title: How to convert this text file to csv?
body: <p>I try analyze text file with data - columns, and records.
  My file:</p>
  
  <pre class="lang-none prettyprint-override"><code>Name     Surname    Age    Sex      Grade
  Chris      M.        14     M       4
  Adam       A.        17     M
  Jack       O.               M       8
  </code></pre>
  
  <p>The text file has some empty data. As above.
  User want to show Name and Grade:</p>
  
  <pre><code>import csv
  
  with open('launchlog.txt', 'r') as in_file:
      stripped = (line.strip() for line in in_file)
      lines = (line.split() for line in stripped if line)
      with open('log.txt', 'w') as out_file:
          writer = csv.writer(out_file)
          writer.writerow(('Name', 'Surname', 'Age', 'Sex', 'Grade'))
          writer.writerows(lines)
  </code></pre>
  
  <p>log.txt :</p>
  
  <pre class="lang-none prettyprint-override"><code>Chris,M.,14,M,4
  Adam,A.,17,M
  Jack,O.,M,8
  </code></pre>
  
  <p>How to empty data insert a "None" string?
  For example:</p>
  
  <pre class="lang-none prettyprint-override"><code>Chris,M.,14,M,4
  Adam,A.,17,M,None
  Jack,O.,None,M,8
  </code></pre>
  
  <p>What would be the best way to do this in Python?</p>