$inputfile = @ScriptDir+"\242.txt"
$outputfile = @ScriptDir+"\242_temp.txt"
$lines = LoadFile($inputfile,@CRLF)
If @Error = 0
For Each $line in $lines
If Left($line,7) = "STATUS:"
$status = Trim(Split($line,":")[1])
Endif
Next
If Len($status) = 4
$fh = FreeFileHandle()
If Open($fh,$outputfile,5) = 0
For Each $line in $lines
If Left($line,6) = "Place:"
$nul = WriteLine($fh,Left($line,20)+$status+@CRLF)
Else
$nul = WriteLine($fh,$line+@CRLF)
Endif
Next
$nul = Close($fh)
Move $inputfile $inputfile+".bkup"
Move $outputfile $inputfile
Else
Exit 1
Endif
Else
Exit 1
Endif
Else
Exit 1
Endif
Function loadfile($file, optional $array, $Uni)
DIM $fso,$f,$fs
if $uni $uni = $uni-3 else $uni = -2 endif
if not $uni $uni = -2 endif
$fso = CreateObject("Scripting.FileSystemObject")
$f = $fso.GetFile($file)
If @ERROR Exit 2 EndIf
$fs = $f.OpenAsTextStream(1,$uni)
if not $array
$loadfile = $fs.Read($f.size)
else
$loadfile = Split($fs.Read($f.size),$array)
endif
Exit @ERROR
EndFunction