没用过Notepad++ ,现在的目的是想已AU3的方式来实现此项功能,有一个易语言的软件不到2秒就搞定了
骗子 发表于 2012-12-10 14:16
Au3 1秒完成Local $sA = FileRead('A.txt'), $sB = FileRead('B.txt')
Local $File1 = 'A中已包含.txt', $File2 = 'C.txt'
Local $ts = TimerInit(), $sFile1 = '', $sFile2 = ''
$sA = StringReplace($sA, '[', '{ }')
Local $aA = StringRegExp($sA, '\V+', 3)
If @error Then Exit 1
For $i = 0 To UBound($aA) - 1
$ss = Assign('~' & $aA[$i], 1)
Next
$sB0 = StringReplace($sB, '[', '{ }')
Local $aB0 = StringRegExp($sB0, '\V+', 3)
If @error Then Exit 2
Local $aB = StringRegExp($sB, '\V+', 3)
If @error Then Exit 3
$File1 = FileOpen($File1, 10)
$File2 = FileOpen($File2, 10 + 128)
For $i = 0 To UBound($aB) - 1
If IsDeclared('~' & $aB0[$i]) Then
$sFile1 &= $aB[$i] & @CRLF
Else
$sFile2 &= $aB[$i] & @CRLF
EndIf
Next
FileWrite($File1, $sFile1)
FileClose($File1)
FileWrite($File2, $sFile2)
FileClose($File2)
MsgBox(64, '完成', '耗时:' & TimerDiff($ts))
|