Sep-04-2017, 09:00 PM
try this:
import csv def read_csv_data(filename): try: buffer = None with open(filename) as csvfile: buffer = csv.reader(csvfile, delimiter=',') for row in buffer: print(row) except csv.Error: print(f'Error reading {filename}') if __name__ == '__main__': read_csv_data('sampleCSV.csv')output:
Output:['1.12005000', '1.11800000', '14574']
['1.11947000', '1.11811000', '8285']
['1.12035000', '1.11749000', '7979']
['1.11812000', '1.11597000', '18181']
['1.13148000', '1.11499000', '30360']
['1.13176000', '1.12344000', '57786']
['1.12441000', '1.11997000', '24175']
['1.12261000', '1.12067000', '14455']
['1.12466000', '1.12198000', '10255']
['1.12643000', '1.12209000', '29588']