我能够生成每行的html文件。在
我当前对“text_file 1.html”的输出是头:['ID', 'Name', 'Type', '3 Year Funds Offered', '3 Year Funds Sold', 'Est. Most Recent Fund Date', 'Investor Location', 'Investor City', 'Investor State', 'Investor Country', 'Portfolio Size', 'Number of Deals', 'Website', 'Average Growth Score']
但我想自定义表/数据,并保留csv中每个数据的标题。
下面是我的示例代码:
import csv
with open('test.csv', 'r') as csvfile:
r = csv.reader(csvfile, delimiter=',')
cnt=0
for row in r:
cnt+=1
file_path="text_file %s.html" % (str(cnt),)
with open(file_path,"w") as text_file:
text_file.write(str(row)+"\n")`enter code here`
你有什么建议可以让我正确地运行这个程序吗?谢谢!在
目前没有回答
相关问题 更多 >
编程相关推荐