sanjay555

Untitled

Sep 14th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import json
  2. import csv
  3. from csv import DictWriter
  4.  
  5. data = []
  6. output_file = open('simran.csv', 'w')
  7. writer = csv.writer(output_file)
  8.  
  9.  
  10. with open("simran.json") as source_file:
  11.    
  12.     for line in source_file:
  13.         data.append(json.loads(line))    
  14.  
  15. for comments in data:
  16.     writer.writerow(comments['text'])
Add Comment
Please, Sign In to add comment