#include <File.au3>
#include <Array.au3>
Local $Detailinfo,$LineDetailinfo,$Computer
Local $Detaillist = InputBox("InputBox","请输入Status文本文件名称","","",250,130)
Local $list = @ScriptDir & "\" & $Detaillist & ".txt"
$Result_log = @ScriptDir & "\" & $Detaillist & "_duplicatioin.xls"
If FileExists($list) = 1 then
$str=FileRead($list)
$array=StringRegExp($str&@CRLF,'(?m)(^.*\r\n)(?=[^\1]*\1)',4)
Else
MsgBox(48,"Error","无法找到原始数据文件,程序将退出!")
Exit
EndIf
Local $sOut=""
$sOut&=$Result_log&@CRLF
For $i=0 To UBound($array)-1
$temp=$array[$i]
For $n=0 To UBound($temp)-1
$sOut&=$temp[$n]
Next
Next
$file = FileOpen($Result_log,1)
If $file = -1 Then
MsgBox(48,"Error","无法打开日志文件,程序将退出!")
Exit
EndIf
FileWrite($file, $sOut)
FileClose($file)
MsgBox(0, 'Info', '程序已运行完成,请查看日志!')
|