import sys
import pandas as pd
import csv
df = pd.read_excel('S046.xls', index_col=0)
df.to_csv('your_csv.csv',encoding="utf_8_sig")
with open('your_csv.csv',newline='',encoding="utf_8_sig") as csv_in_file:
with open('your_csv1.csv', 'w', newline='') as csv_out_file:
filereader = csv.reader(csv_in_file)
filewriter = csv.writer(csv_out_file)
header_list = ['<ApplicableDevices><Device Manufacture="莫迪康" Category="PLC" Model="Slave" /></ApplicableDevices>']
filewriter.writerow(header_list)
for row in filereader:
filewriter.writerow(row)
pandas
最新推荐文章于 2023-01-11 09:19:21 发布