这可能是一个非常简单的,但我刚刚回到 python 的世界。我有一个 .csv 文件,例如
FRAME, SEQID, CYCLE SEC, CYCLE COUNT, SIZE, GAMMA, GAIN0, GAIN1, GAIN2, GAIN3, GAIN4, GAIN5, SHUTTER0, SHUTTER1, SHUTTER2, SHUTTER3, SHUTTER4, SHUTTER5, LAT, LON, ALT, UTC
000000, 3371, 058, 0000, 3951616, 0.000, 64,64,64,64,64,64, 34,34,34,34,34,34, 52.53922000, 0.79127400, 48.300, 11:06:35.00
000001, 3372, 060, 0000, 3954176, 0.000, 64,64,64,64,64,64, 34,34,34,34,34,34, 52.53922033, 0.79127483, 48.400, 11:06:37.00
000002, 3373, 062, 0000, 3955200, 0.000, 64,64,64,64,64,64, 34,34,34,34,34,34, 52.53922050, 0.79127600, 48.400, 11:06:39.00
我需要提取 'FRAME,LAT,LON' 然后在 .xml 文件中将其格式化为这样。
<?xml version="1.0" encoding="utf-8"?>
<viewpointlist>
<viewpoint>
<vpid>VP000001</vpid>
<lat>52.5254</lat>
<lng>0.70886</lng>
</viewpoint>
<viewpoint>
<vpid>VP000002</vpid>
<lat>52.5254</lat>
<lng>0.70886</lng>
</viewpoint>
正如我所说,可能是一个简单的,它已经很长时间了。预先感谢。保罗