I am very new to Python. I want to parse a csv file such that it will recognize quoted values – for example
1997,Ford,E350,”Super, luxurious truck”
should be split as
(‘1997’, ‘Ford’, ‘E350’, ‘Super, luxurious truck’)
and NOT
(‘1997’, ‘Ford’, ‘E350’, ‘”Super’, ‘ luxurious truck”‘)
the above is what I get if I use something like str.split(,).
How do I do this?
Also would it be best to store these values in an array or some other data structure? because after I get these values from the csv I want to be able to easily choose, lets say any two of the columns and store it as another array or some other data structure.
The following method worked perfectly
The columns are stored in dictionary with the column names as the key.