title: extracting data from .txt and writing it to .csv
body: <p>I have a txt file with json tweets, 
  every tweet is between ["text": &amp; "is_quote_status":], 
  i have manged to extract just the tweets, now i want to write the print output line by line to a csv.</p>
  
  <pre><code>import csv
  with open('trumpT.csv', "wb") as csvfile:
      writer = csv.writer(trumpT.csv, delimiter=',')
  with open('sim.txt', 'rb') as f:
      for line in f:
          line.split('"text" :')[1].split(', "is_quote_status')[0]
          writer.writerow(line)
  </code></pre>
  
  <p>Error
      writer = csv.writer(trumpT.csv, delimiter=',')
      NameError: name 'trumpT' is not defined</p>
  
  <p>I able to get this part right but the csv is not working?</p>
  
  <pre><code>with open('sim.txt', 'rb') as f:
      for line in f:
          print line.split('"text" :')[1].split(', "is_quote_status')[0]
  </code></pre>