Nubie,
This one uses dynamically created variables (assign/eval) and does 2 files of 100000 in under 5 secs (again on a row boat PC).
#include <array.au3>
local $fl_name1 = @scriptdir & 'f11.txt' ; test file #1
local $fl_name2 = @scriptdir & 'f12.txt' ; test file #2
local $hlf, $ix = 100000 ; number of lines for test files
; generate two test files (format = 'random uppercase alpha' and '=' and 'random number between 0 and 9' and '0'
; file #1 does not contain any values starting with 'z' therefore resulting string will only have value starting with 'z'
for $i = 1 to 2
consolewrite(eval('fl_name' & $i) & @lf)
$hfl = fileopen(eval('fl_name' & $i),2)
if $hfl = -1 then msgbox(0,'ERROR','Error opening file = ' & eval('fl_name' & $i))
for $k = 0 to $ix
if $i = 1 then
filewrite($hfl,chr(random(65,89,1)) & '=' & chr(random(48,57,1)) & '0' & @CRLF)
Else
filewrite($hfl,chr(random(65,90,1)) & '=' & chr(random(48,57,1)) & '0' & @CRLF)
endif
Next
fileclose($hfl)
$hfl = 0
next
local $st = timerinit()
local $sDiff = _FindUniqueInFile2(fileread($fl_name1),fileread($fl_name2))
consolewrite('time to run func = ' & round(timerdiff($st)/1000,2) & @lf)
$aDiff = stringsplit($sDiff,'|',2)
_arraydisplay($aDiff,ubound($aDiff))
func _FindUniqueInFile2($str1,$str2)
local $afile1 = stringsplit($str1,@crlf,3)
local $afile2 = stringsplit($str2,@crlf,3)
local $out_str
for $i = 0 to ubound($afile1) - 1
assign('s' & $afile1[$i],1)
Next
for $i = 0 to ubound($afile2) - 1
if isdeclared('s' & $afile2[$i]) then
else
$out_str &= stringleft($afile2[$i],1) & '=' & stringright($afile2[$i],2) & '|'
endif
Next
$out_str = stringtrimright($out_str,1)
return $out_str
endfunc
kylomas