Jump to content

Compare two file txt with _ArraySearch [SOLVED]


rootx
 Share

Recommended Posts

:). THX

I should use _arraysearch or there is another function to be used?

#include <Array.au3>
#include <File.au3>

Global Const $sFilePath = @ScriptDir&"\1.txt",$sFilePath2= @ScriptDir&"\2.txt"

FileOpen($sFilePath,$FO_OVERWRITE)
    For $x = 1 to 10
        FileWriteLine($sFilePath,$x&"test")
    Next
FileClose($sFilePath)

FileOpen($sFilePath2,$FO_OVERWRITE)
    For $x2 = 1 to 5
        FileWriteLine($sFilePath2,$x2&"test")
    Next
FileClose($sFilePath2)

Local $aRetArray,$aRetArray2
$aArray = _FileReadToArray($sFilePath,$aRetArray)
$aArray2 = _FileReadToArray($sFilePath2,$aRetArray2)

    If UBound($aRetArray) > UBound($aRetArray2) Then
        For $s = 1 To UBound($aRetArray) - 1
            $search = _ArraySearch($aRetArray2, $aRetArray[$s])
            If @error = 6 Then
                MsgBox(48, "Attention", $aRetArray[$s] & " was not found!!!")
            EndIf
        Next
    EndIf

 

Edited by rootx
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...