将.txt转换为3列xlsx格式

时间:2016-09-19 12:25:57

标签: python-2.7

我是python脚本的新手,我正在使用python 2.7版本,我有.txt格式的数据,如下所示

DTMTYEAR  LAT.  67.5  68.5  69.5  70.5  71.5  72.5  73.5  74.5  75.5  76.5  77.5  
01011951   7.5 99.90 99.90 99.90 99.90 99.90 99.90 99.90 99.90 99.90 99.90 99.90 
01011951   8.5 99.90 99.90 99.90 99.90 99.90 99.90 31.45 99.90 99.90 30.02 31.19 
01011951   9.5 99.90 99.90 99.90 99.90 99.90 99.90 99.90 99.90 99.90 30.18 29.93 
01011951  10.5 99.90 99.90 99.90 99.90 99.90 99.90 99.90 99.90 29.08 27.62 27.91 
01011951  11.5 99.90 99.90 99.90 99.90 99.90 30.11 99.90 99.90 28.32 27.28 28.28 

我希望这些数据采用xlsx格式,如下所示

 x    y     value
7.5 67.5    99.90
7.5 68.5    99.90
7.5 69.5    99.90
7.5 70.5    99.90
7.5 71.5    99.90
7.5 72.5    99.90
7.5 73.5    99.90
7.5 74.5    99.90
7.5 75.5    99.90
7.5 76.5    99.90
7.5 77.5    99.90
8.5 67.5    99.90
8.5 68.5    99.90 

依旧......

请帮我怎么做。

0 个答案:

没有答案