I have a .txt file with this inside - 2.9,Gardena CA
What I\'m trying to do is convert that text into a .csv (table) using a python script:
import c
This is how I do it:
with open(txtfile, 'r') as infile, open(csvfile, 'w') as outfile: stripped = (line.strip() for line in infile) lines = (line.split(",") for line in stripped if line) writer = csv.writer(outfile) writer.writerows(lines)
Hope it helps!