I have file.txt
with five columns and 50 lines. I want to name each column
1 5
2 4.2
. .
. .
答案 0 :(得分:0)
你在这里找到代码python ton generate file.txt
f = open("test_01.txt", "a")
for i in xrange(len(end_zapstart_zap)):
f.write(" {} {} {} {} {} \n".format(Leavestart_zap[i],end_zapUDP[i],end_zapstart_zap[i],Leave_join[i],UDP_join[i]))
f.close()
我喜欢重命名第一列Leavestart_zap,seond列end_zapUDP等。 这是我的文件test_01.txt:
0:00:00.672511 0:00:02.615662 0:00:03.433344 0:00:00.119777 0:00:00.025394 0:00:00.002278 0:00:00.263144 0:00:03.184893 0:00:03.541187 0:00:00.090872 0:00:00.025394 0:00:00.002278