For the first time I come across a CSV format. For experiments, I created an example.csv
file with the following contents:
first name, last name, module1, module2, module3, description student, best, 100, 100, 100, Excellent score student, good, 90, "90,2", 100, "Good score but could do better"
The problem is that, as far as I understand, the values ​​separated by quotes should go together as one value. But when I run the following script:
import csv with open("D:\\pytest\example.csv") as f: reader = csv.reader(f) for row in reader: print(row)
I see the following result:
['first name', ' last name', ' module1', ' module2', ' module3', ' description'] ['student', ' best', ' 100', ' 100', ' 100', ' Excellent score'] ['student', ' good', ' 90', ' "90', '2"', ' 100', ' "Good score'] ['but could do better"']
Why are 90 and 2 in the third line going separately and at the end of the line is not written together?