Here is my file_t.JSON am writing from Request content to a csv/json file
{"w1":"R"}
{"w2":"R2"}
{"w3":"R3"}
{"w4":"R4"}
{"w5":"R5"}
I'm expecting that my code below should give me the below result Expecting output.csv
w1 r
w2 R2
w3 R3
W4 R4
w5 R5
Here is my code
import csv
f1 = file ("output.csv","w")
f2 = file ("file_t.JSON","rU")
with open("file_t.JSON") as f:
csvr = csv.reader(f, delimiter=' ')
csvr.next()
for rec in csvr:
key, values_txt = rec
values = values_txt.split(',')
print key, values
f1.write(values)
It is not printing, writing to the output file.