;~Local $Str1 = FileRead('txt1.txt')
Local $Str1 = _
'标题1;标题2;标题3' & @CRLF & _
'X8Y229G-77;http://192.168.0.1/XXXX/XXXX' & @CRLF & _
'W9T229P-66;http://192.168.0.1/XXX/XXXXX'
;~Local $Str2 = FileRead('txt2.txt')
Local $Str2 = _
'标题a;标题b' & @CRLF & _
'西吧勿二二九基杠凄凄;1' & @CRLF & _
'无久踢二二九批杠六六;1'
Local $aSR1 = StringRegExp($Str1, '\V+', 3)
If @error Then Exit
Local $aSR2 = StringRegExp($Str2, '\V+', 3)
If @error Then Exit
If UBound($aSR1) <> UBound($aSR2) Then Exit (MsgBox(48, '注意', '两份行数不一致。'))
Local $sOut = $aSR1[0] & @CRLF, $i, $OutFile = 'txt3.txt'
For $i = 1 To UBound($aSR1) - 1
$sOut &= $aSR1[$i] & $aSR2[$i] & @CRLF
Next
FileWrite(FileOpen($OutFile, 2), $sOut)
|