#include <array.au3>
#include <file.au3>
local $array
_FileReadToArray("bb.txt",$array)
local $out_array[UBound($array)][7],$k=1,$str
for $i=1 to $array[0]
$temp=StringSplit(StringStripWS($array[$i],4),chr(32),2)
$temp[1]=_format($temp[1])
$temp[2]=_format($temp[2])
for $n=0 to 3
$out_array[$i][$n]=$temp[$n]
Next
$out_array[$i][5]='-'
$out_array[$i][6]=$temp[4]
if not IsDeclared($temp[4]) then
Assign($temp[4],$k)
$k+=1
EndIf
Next
;_ArraySort($out_array,0,0,0,6);如果需要排序
for $i=1 to $array[0]
if IsDeclared($out_array[$i][6]) then $out_array[$i][4]=Eval($out_array[$i][6])
Next
_ArrayDisplay($out_array)
for $i=1 to UBound($out_array)-1
for $n=0 to UBound($out_array,2)-1
$str&=$out_array[$i][$n]&@TAB
Next
$str&=@CRLF
Next
msgbox(0,0,$str)
func _format($num)
return StringFormat('%+04d',$num)&StringTrimLeft(StringFormat('%.3f',StringRegExpReplace($num,'(.+)(?=\.)','')),1)
EndFunc
|