macie's right ... was thinking too complex
here's mine slightly more condensed :
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)
$_ = open(1,$FileArray[$i])
$l = readline(1)
while not @error
if ascan($OutStrArray,$l) = -1
$OutStrArray[ubound($OutStrArray)] = $l
redim preserve $OutStrArray[ubound($OutStrArray)+1]
endif
$l = readline(1)
loop
$_ = close(1)
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
Edited by Jochen (2004-08-26 03:35 PM)
_________________________