Yesterday, I happened to find a fascinating code written by Marielle in a forum posting some time ago. She mentioned it as being perhaps the fastest script she had found to remove duplicates from a list. I can see that it is a custom function and an array, and I've experimented with it for some time but don't know how to get it to work.
Here's some of the things I'm a bit confused about:
I see the function name is "list.deleteDuplicates" so I was wondering if the "." between "list" and "delete" is supposed to be there?
Also, I'm not sure how one would call this function. For instance, would you have a mouseDown handler that puts your list into an array called "list.deleteDuplicates" first or what?
Code: Select all
function list.deleteDuplicates pList
split pList by cr and space
combine pList by cr and space
return pList
end list.deleteDuplicates
I have made a number of experimental programs that will delete duplicate words from a list but they're a bit too slow when the list consists of tens of thousands of words. If anyone could briefly explain the above script to me or show the script that would call this handler into action, it would be greatly appreciated.
Basically my big lists of words are in single column, alphabetical order, on separate lines with a CR, but I know that I have many repeated words in those databases that are supposed to have only one of each word, and I have quite a few different databases to clean up, so a fast way to do this would be a fantastic asset.
As always, thanks in advance for all the knowledge this forum imparts.
All the best, deeverd