import pandas as pd
import os
dir_list=os.listdir(r'C:\Users\s\Desktop\I10A-B301\B301人工核查\数据集分类合并\核查条目')
for i in (dir_list):
result=pd.ExcelWriter(r'C:\Users\s\Desktop\I10A-B301\B301人工核查\数据集分类合并\output\SCT-I10A-B301-{}-SYL20200520.xls'.format(i))
origin_file_list=os.listdir(r'C:\Users\s\Desktop\I10A-B301\B301人工核查\数据集分类合并\核查条目\{}'.format(i))
print(origin_file_list)
for n in (origin_file_list):
excel_file_name=n
file_path=r'C:\Users\s\Desktop\I10A-B301\B301人工核查\数据集分类合并\核查条目\{0}\{1}'.format(i,n)
print (file_path)
content = pd.read_csv(file_path,encoding='UTF-16',delimiter="\t")
sheet_name = n[:len(n) - 4]
content.to_excel(result, sheet_name, index=False)
result.save()