$file = @ScriptDir & "\ProcessSafe.ini"
$filew = @ScriptDir & "\out.txt"
$n = 0
$m=_FileCountLines($file)
$fh = FileOpen($file, 0)
$fhw = FileOpen($filew, 2)
ProgressOn("正在处理...","正在处理第 行")
While 1
$n += 1
$line = FileReadLine($fh)
If @error = -1 Then ExitLoop
$b = StringRegExp($line, "(\w+\.)+\w+", 2)
If IsArray($b) Then FileWrite($fhw, $b[0]&@CRLF);如查不需要Local_ProcessDeny段,在此处加上判断
ProgressSet(Ceiling($n/$m*100),"正在提取:"&$line,"正在处理第"&$n&"行")
WEnd
FileClose($fh)
FileClose($fhw)
ProgressOff()
ShellExecute($filew)
Exit
Func _FileCountLines($sFilePath)
Local $N = FileGetSize($sFilePath) - 1
Local $M= ""
If @error Or $N = -1 Then Return 0
$M=FileRead($sFilePath)
$M=StringReplace($M,@CRLF,@CR)
$M=StringSplit($M,@CR)
Return $M[0]
EndFunc ;==>_FileCountLines
|