import os
import pandas as pd
import glob
csv_list = glob.glob('D:/Users/sq/Desktop/新建文件夹/*.csv')
print(u'共发现%s个CSV文件' % len(csv_list))
print(u'正在处理............')
ii = 0
for i in csv_list:
if ii == 0:
fr = open(i, 'r')
fr = fr.read()
with open('D:/Users/sq/Desktop/新建文件夹/hb.csv', 'w', encoding='utf-8_sig') as f:
f.write(fr)
ii = ii + 1
else:
fr = open(i, 'r')
next(fr)
fr = fr.read()
with open('D:/Users/sq/Desktop/新建文件夹/hb.csv', 'a',encoding='utf-8_sig') as f:
f.write(fr)
print(u'合并完毕!')
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧