Finding duplicates in a list
Thierry
00bioarchimed at free.fr
Wed Jan 9 06:59:04 EST 2008
Hi,
MacBook: 17 to 25 ms
with 691 duplicates from 8708 files !!!!!!
seems we don't have same results ?
Regards,
Thierry
on mouseUp
-- number of lines: N
-- all your files: tList
put "Ok start..." & cr into field "Fresult"
put the milliseconds into tt
put empty into listOfDuplicates
put 0 into currentLineNumber
repeat for each line tLine in tList
add 1 to currentLineNumber
if AlreadySeen[ tLine] is empty then
-- first time we see this one !
put 1 into AlreadySeen[ tLine]
else
-- a duplicate one !
put currentLineNumber & comma after listOfDuplicates
end if
end repeat
put the milliseconds - tt & cr after fld "Fresult"
-- only for debug
put "number of files:" && N & cr after fld "Fresult"
delete last char of listOfDuplicates
put "number of Dups:" &&
the number of items of listOfDuplicates & cr after fld
"Fresult"
end mouseUp
More information about the use-livecode
mailing list