file = open('a.txt','r')
for i in file:
a = i.split(',')[0]
b = i.split(',')[1].rstrip('\n')
file2 = open('d.txt','a')
c = "UPDATE t SET t.a=a WHERE t.b ='%s';\n" % (a,b)
file2.write(c)
file2.close()
file.close()
python读取文件a写入到文件b中(TXT)
最新推荐文章于 2024-05-03 21:14:49 发布