Так ? :
Код:
;$sFilePath="c:\Users\All Users\Microsoft\FSX\Scenery.CFG"
$sFilePath=@ScriptDir & "\1.txt"
$sText=FileRead($sFilePath)
MsgBox(0,'$sText',$sText)
$sPattern="(?s).+(\[.+?)"
$sFind=StringRegExpReplace($sText,$sPattern,"\1")
$sPattern="(.+[=.])(.+)"
$aFind=StringRegExp($sFind,$sPattern,3)
$sRet=''
For $i=0 To UBound($aFind)-2 Step 2
If $i=0 Or $i=8 Then $aFind[$i+1]+=1
If $i=0 Then $aFind[$i+1]&= "]"
$sRet&= $aFind[$i] & $aFind[$i+1] & @LF
Next
ConsoleWrite($sRet & @LF)
$hFile=FileOpen($sFilePath,1)
FileWrite($hFile,$sRet)
FileClose($hFile)