jagordon Posted February 1, 2008 Posted February 1, 2008 Is there a function that will allow you to compare the contents of 2 files? I'm looking for a shortcut, instead of populating arrays and looping through them. :-)
Paulie Posted February 1, 2008 Posted February 1, 2008 $File1 = *Path Here* $File2 = *Path Here* $F_1 = FileOpen($File1,0) $F_2 = FileOpen($File2,0) If FileRead($F_1) = FileRead($F_2) then Msgbox(0,"","Files are the same") Else Msgbox(0,"","Files are different") Endif
randallc Posted February 1, 2008 Posted February 1, 2008 (edited) Is there a function that will allow you to compare the contents of 2 files? I'm looking for a shortcut, instead of populating arrays and looping through them. :-)Hi, Not a shortcut, but fast and in AutoIt, and pre-writtendisplay UDF; I also need someone to test it! Best, Randall ; ArrayCompareEx2a.au3 #include<ArrayDupes8.au3> #include<_ArrayDisplaySort.au3> Local $iNum = 1000 local $ar_Array1[$iNum],$ar_Array2[1] For $i = 0 To $iNum - 1 $ar_Array1[$i] = "Item" & $i Next $ar_Array2=$ar_Array1 For $i = 0 To $iNum - 1 step 50 $ar_Array2[$i] = "Items2Add" & $i Next Local $ar_UnMatchedItems = _ArrayCompare($ar_Array1, $ar_Array2, 1, 0, 1, 1) If $ar_UnMatchedItems[UBound($ar_UnMatchedItems) - 1] <> "" Then _ArrayDisplaySort($ar_UnMatchedItems, "$ar_Array1 vs $ar_Array2", 0, 10) Edited February 1, 2008 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now