我想使用此代码通过python导出csv
with open(idFile+'.csv', 'wb') as csvfile:
f = csv.writer(csvfile)
f.writerow(["System", "Title", "Status", "result", "iStatus","Detail","Open Date","Closed Date","Status"])
for x in range(0,len(dataDownload['item'])):
f.writerow([dataDownload['item'][x]["system"],
dataDownload['item'][x]["title"],
dataDownload['item'][x]["stats"],
dataDownload['item'][x]["result"],
dataDownload['item'][x]["i_status"],
dataDownload['item'][x]["detail"],
dataDownload['item'][x]["open_date"],
dataDownload['item'][x]["closed_date"],
dataDownload['item'][x]["status"],
])
return f
它已成功导出,但是我想用excel打开它,它使数据看起来很糟糕,列错了。它始于令人惊讶的结果
数据具有换行符,我已经尝试将其替换为“”,但无效。