;Local $str1 = FileRead('1.txt') ;或以下字符串测试
Local $Str1 = _
'abc 123 swd' & @CRLF & _
'bcd 231 rre' & @CRLF & _
@CRLF & _
@CRLF & _
'der 323 ood' & @CRLF
;Local $str2 = FileRead('2.txt') ;或以下字符串测试
Local $Str2 = _
'rbc 123 swd' & @CRLF & _
'bdd 231 rre' & @CRLF & _
'der 323 ood'
Local $sR1 = StringRegExp($Str1, '[^\r\n]+', 3)
If @error Then Exit
Local $sR2 = StringRegExp($Str2, '[^\r\n]+', 3)
If @error Then Exit
If UBound($sR2) < UBound($sR1) Then Exit
Local $out, $File = '3.txt'
For $i = 0 To UBound($sR1) - 1
$out &= $sR1[$i] & '—' & $sR2[$i] & @CRLF
Next
FileDelete($File)
If FileWrite($File, $out) Then ShellExecute($File)
|