Question on the "csv" library
vicente.soler at gmail.com
Thu Aug 27 21:06:53 CEST 2009
I am trying to read a csv file generated by excel.
Although I succeed in reading the file, the format that I get is not
suitable for me.
>>> import csv
>>> spamReader = csv.reader(open('C:\\abc.csv', 'r'))
>>> print spamReader
<_csv.reader object at 0x01022E70>
>>> for row in spamReader:
My questions are:
1- Why using "print spamReader" I cannot see the data?
I expected to see a list of lists, a kind of a matrix, but I get
2- Why are the rows in a single string?
I expected a list of fields that, when text, would be delimited by
To tell the truth, the file generated by excel does not contain the
strings delimited by ". Isn't it weird?
3- Is there anything I can do to have my data in a list of lists
structure? would another kind of data suit better my needs?
Thank you for your help
More information about the Python-list