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 are looking to read a csv with comma delimiter and write it in another file with semicolon delimiters. I think a more straightforward way would be:
reader = csv.reader(open("input.csv", "rU"), delimiter=',')
writer = csv.writer(open("output.csv", 'w'), delimiter=';')
writer.writerows(reader)
I find this example much easier to understand than with the with open(...).
Also if you work with file using comma and semicolon as delimiters. You can use the Sniffer of the csv file to detect which delimiter is used before reading the file (example in the link).
Also if you want to rewrite in the same file, check this stackoverflow answer.