Evet haklıymışsın Kelime sayısı tek ise ( 3,5,7 ...) sorun çıkyormuş. Nedeni ise daha önceki toplanan veri üzerinde silme yaptığımız için.
Ufak ek yaptım. İyi tespit etmişsin :wink:
Kod: Tümünü seç
#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 360, 405)
$Edit1 = GUICtrlCreateEdit("", 41, 48, 119, 121)
$Edit2 = GUICtrlCreateEdit("", 200, 48, 121, 121)
$Sil = GUICtrlCreateButton("Sil", 256, 368, 75, 25)
$Edit3 = GUICtrlCreateEdit("", 48, 184, 281, 176)
GUISetState(@SW_SHOW)
;Sen ayarlarsın bu kısmı
GUICtrlSetData($Edit1, "Merhaba Dünya" & @crlf & "bu gün" & @crlf & "123")
GUICtrlSetData($Edit2, "Merhaba Bu gün hava günesli" & @crlf & "123 123")
;~ $AddTxtFile1 = FileOpen(@ScriptDir & '\File1.txt', 0)
;~ GUICtrlSetData($Edit1, FileRead($AddTxtFile1))
;~ $AddTxtFile2 = FileOpen(@ScriptDir & '\File2.txt', 0)
;~ GUICtrlSetData($Edit2, FileRead($AddTxtFile2))
Local $Value1,$Value2,$Value3,$Value4
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Sil
$Value1 = _Split_Word(GUICtrlRead($Edit1))
$Value2 = _Split_Word(GUICtrlRead($Edit2))
$Value3 = ""
$Value4 = @CRLF
For $I = 1 To $Value1[0]
If StringInStr($Value4,@CRLF & $Value1[$I] & @CRLF) = 0 Then
$Value3 &= $Value1[$I] & @CRLF
$Value4 &= $Value1[$I] & @CRLF
Else
$Value3 = StringReplace($Value3,$Value1[$I] & @CRLF,"")
EndIf
Next
For $I = 1 To $Value2[0]
If StringInStr($Value4,@CRLF & $Value2[$I] & @CRLF) = 0 Then
$Value3 &= $Value2[$I] & @CRLF
$Value4 &= $Value2[$I] & @CRLF
Else
$Value3 = StringReplace($Value3,$Value2[$I] & @CRLF,"")
EndIf
Next
GUICtrlSetData($Edit3,StringStripWS($Value3,3))
EndSwitch
WEnd
Func _Split_Word($sText)
Local $ret = StringRegExp($sText, '^|"([^"]*)"|\S+', 3)
$ret[0] = UBound($ret)-1
Return $ret
EndFunc