字符串内容:(OCC)COMBINATION # 1
10 2100 1684 6829 9691 9853 2136 Rigid ANC
(OCC)COMBINATION # 2
130 2100 223 2740 2740 0 0 Rigid +Z
(OCC)COMBINATION # 2
130 2600 223 2740 2740 0 0 Rigid +Z
(OCC)COMBINATION # 1
130 0 0 2740 0 0 0 Rigid +Z
(OCC)COMBINATION # 2
130 0 2964 0 0 0 0 Rigid GUI
(OCC)COMBINATION # 2
130 0 0 2740 0 0 0 Rigid +Z
#include <array.au3>
If FileExists("test.txt") Then FileDelete("test.txt")
$str=FileRead("1.txt");1.txt文件内容为楼主提供字符串
$arr=StringRegExp($str,'\([^()]*?\).+\n.+',3)
_ArraySort($arr)
;_ArrayDisplay($arr)
For $i=0 To UBound($arr)-1
$str1=StringStripWS($arr[$i],4)
$str2=StringReplace($str1,21,"=")
$arr2=StringSplit($str2,"=")
IniWrite("test.txt",$arr2[1],$i,$arr2[2])
Next
MsgBox(0,0,StringRegExpReplace(FileRead("test.txt"),'\d=',''))
|