I suspect this is a common problem, but I counldn\'t seem to locate the answer. I am trying to remove all commas from a csv file and replace them with colons. I would normal
If you're just replacing commas with colons, you don't need to use a csv parser at all.
with open("file.csv", 'r') as f: with open("temp.csv", 'w') as t: for lines in f: new_line = line.replace(",",":") t.write(new_line)
The only caveat is that you can't have commas elsewhere in the csv file.