txtname C:/Users/123/Desktop/SRRLdata/parameter.txt #txt路径
excelname C:/Users/123/Desktop/parameter.xlsx #要保存的excel路径
fopen open(txtname, r )
lines fopen.readlines()
wb openpyxl.Workbook()#创建1个工作簿
ws wb.create_sheet(u Data_L )#用工作簿去创建工作表sheet
i 1#从第一行开始
l len(lines)
for j in range(0,l):
line lines[j]
line line.strip( n )
line line.split( , )#txt列与列通过 , 分隔
s line[0]#有几列就建立几个line
a line[1]
b line[2]
c line[3]
d line[4]
e line[5]