with open('C:\\Users\\dell\\Desktop\\test.txt', 'r') as a:#前列txt
with open('C:\\Users\\dell\\Desktop\\test1.txt', 'r') as b:#后列txt
with open('C:\\Users\\dell\\Desktop\\trainhebing.txt', 'w') as c:#合并后txt
for line in a:
c.write(line.strip('\r\n')+",")
linea=b.readline()
c.write(linea.strip('\r\n')+",")
c.write("\n")
4.txt文档的合并
最新推荐文章于 2024-08-10 23:14:03 发布