使用python实现对csv插入一行标题栏
path = 'demo.csv'
index = 'A,B,C'
with open(path, 'r+', encoding='utf-8') as f:
content = f.read()
f.seek(0, 0)
f.write(index + '\n' + content)
使用python实现对csv插入一行标题栏
path = 'demo.csv'
index = 'A,B,C'
with open(path, 'r+', encoding='utf-8') as f:
content = f.read()
f.seek(0, 0)
f.write(index + '\n' + content)