Hi can someone please tell me why i have an invalid syntax that appear in the last line exactly in the second " this is a script that iterates through the CSV file and converts everything to the decimal ASCII equivalent. Thank you
import csv
with open('C:\Users\user\Desktop\log_transformed_truncated.csv', 'w') as outfile:
c = csv.writer(outfile)
counter = 0
with open('C:\Users\user\Desktop\log.csv','rb') as f:
for row in csv.reader(f, delimiter=';'):
counter = counter + 1
mod_row = []
if counter != 1:
for cell in row:
mod_row.append(sum(bytearray(cell)))
else:
for cell in row:
mod_row.append(cell)
c.writerow(mod_row)
print "processed {} rows".format(counter)