I struggled a bit with it and came out with a weird execute() construct ...
Advantage of this is that it doesn't matter how many files and lines you have ... Memory is the limit so to say


Code:
break on

$Out = @scriptdir + "\result.txt"
$FileArray = @scriptdir + "\file1.txt",@scriptdir + "\file2.txt",@scriptdir + "\file3.txt"
Global $OutStrArray[0]

for $i = 0 to ubound($FileArray)
$_ = execute("Global $$StringArray$i[0]")
next

for $i = 0 to ubound($FileArray)
$_ = open(1,$FileArray[$i])
$c = 0
$l = readline(1)
while not @error
$_ = execute("redim preserve $$StringArray$i[$$c]")
$_ = execute("$$StringArray$i[$$c] = $$l")
$c = $c + 1
$l = readline(1)
loop
$_ = close(1)
next

for $i = 0 to ubound($FileArray)
$_ = execute("for $$j = 0 to ubound($$StringArray$i)
if ascan($$OutStrArray,$$StringArray$i[$$j]) = -1
$$OutStrArray[ubound($$OutStrArray)] = $$StringArray$i[$$j]
redim preserve $$OutStrArray[ubound($$OutStrArray)+1]
endif
next")
next

if ubound($OutStrArray) redim preserve $OutStrArray[ubound($OutStrArray)-1] endif

if exist($out) del $out endif

$_ = open(1,$out,5)

for each $e in $OutStrArray
$_ = writeline(1,$e + @crlf)
next

$_ = close(1)

exit 1


_________________________