每个人。
我想将 csv 解析"20568078","240431","jpg","St, Carolina 1920",,
为["20568078","240431","jpg","St, Carolina 1920","",""]
通过使用这个:
string=r'"20568078","240431","jpg","St, Carolina 1920",,'
reader = csv.reader(string)
for r in reader:
print (r)
我得到了输出:
['20568078']
['', '']
['240431']
['', '']
['jpg']
['', '']
['St, Carolina 1920']
['', '']
['', '']
我想知道如何删除不必要的['', '']
,并将最后两个更改,,
为""
and""
谢谢你。