So, I have a python tuple. I am trying to write it to a CSV file. What I did so far I am able to write to the CSV but all my data appears in one row. Can anyone tell me how can I convert it into columns ? For example this is the data in one row on my CSV.
100 0.01 11139155 5569534 0.499996 NO SYNC 555 0.01 2306110 1153050 0.499998 NO SYNC 333 0.22 3434535 4446466 0.453535 NO SYNC
What I want to do I want to organize this tuple in a way that after each NO SYNC it moves to the next row.
100 0.01 11139155 5569534 0.499996 NO SYNC
555 0.01 2306110 1153050 0.499998 NO SYNC
333 0.22 3434535 4446466 0.453535 NO SYNC
This is my script
with open ('File path') as f:
writer = csv.writer(f, delimiter = ',')
writer.writerow(results_t1)
f.close()
Where results_t1 is my input tuple.
My input tuple looks like this :
(100, 0.01, 11139155, 5569534, 0.499996094856387, 'NO SYNC', 555, 0.01, 2306110, 1153050, 0.499997831846703, 'NO SYNC', 3081, 0.01, 1951735, 975863, 0.499997694359122, 'NO SYNC', 17100, 0.01, 2896740, 1448360, 0.499996547843438, 'NO SYNC', 94912, 0.01, 1800105, 900045, 0.499995833576375, 'NO SYNC', 526805, 0.01, 2290245, 1145113, 0.499995851972169, 'NO SYNC', 2924018, 0.01, 2256745, 1128371, 0.499999335325879, 'NO SYNC', 16229682, 0.01, 2004625, 1002304, 0.49999575980545, 'NO SYNC', 90082412, 0.01, 1912945, 956468, 0.499997647606178, 'NO SYNC', 500000000, 0.01, 1421040, 710518, 0.499998592580082, 'NO SYNC'
)