我正在尝试使用 python 进行简单的 csv 解析,我有以下代码:
print csvdata
print "\n"
csvparsed = csv.reader(csvdata)
for row in csvparsed:
print row
但是,似乎解析数据的每一行都是一个字符,并且没有用逗号分隔。我在这里错过了什么吗?这是我得到的输出:
Restaurant ID,2,,
,,,
Menu Name,Breakfast Menu,,
['R']
['e']
['s']
['t']
['a']
['u']
['r']
['a']
['n']
['t']
[' ']
['I']
['D']
['', '']
['2']
['', '']
['', '']
[]
['', '']
['', '']
['', '']
[]
['M']
['e']
['n']
['u']
[' ']
['N']
['a']
['m']
['e']
['', '']
['B']
['r']
['e']
['a']
['k']
['f']
['a']
['s']
['t']
[' ']
['M']
['e']
['n']
['u']
['', '']
['', '']