Apr-25-2017, 04:16 AM
Just use csv module
import csv with open('/tmp/input.csv', 'r') as in_file: data = csv.reader(in_file, delimiter=',') for row in data: print([col.replace(',', '^') for col in row])
Output:['Id', 'Category', 'Description', 'Date']
['1', 'Test', 'Red Cars', '02/12/2017']
['2', 'Test', 'Blue Cars', '03/01/2017']
['3', 'Test', 'Green^ big cars', '01/05/2016']