Is it possible to modify all csv-files (240 in total) which are located in the same folder/directory with Python? The csv files consist test results and these are listed all in the first column instead of several columns. With the modification I would like to replace the comma (,) with a semicolon (;) of all csv files to get example B) below:
A) Content example of one csv-file (before modification via Python script):
Column A: Column B: Column C: Column D: Column E:
1, 65, 165, 484, 15,
0, 46, 49, 4, 66,
etc.
B) Content example of one csv-file (after modification via Python script):
Column A: Column B: Column C: Column D: Column E:
1 65 165 484 15
0 46 49 4 66
etc.
I haven't found any example yet. Have you implemented something like that already? Or is there a better solution then Python? I know you can do it in Excel, but I don't want do repeat that 240 times.
Update: MY SOLUTION
I did it with the following code and it works. But between each row I have an empty row. I don't understand why??
with open('_' + csv_name, mode="w") as outfile:
writer = csv.writer(outfile, delimiter=';')
with open(csv_name, mode="rU") as infile:
print(csv_name)
reader = csv.reader(infile, dialect="excel")
for row in reader:
print(row)
writer.writerow(row)
Every csv-file int the same folder as the *.py file is modified.