Quickly select a random word from a large list

Hey there!

I'm trying to select a random word from a large list of words (300,000 lines) in a text file.

I've set-up the Macro from this thread:

It works great for a smaller list of words, but when trying to run it on a larger list the macro doesn't complete until 10 minutes later or so.

Any suggestions on a faster macro method for selecting a random word (or line) from a long list?

I took a block of text from Wikipedia, duplicated it until it was over 400,000 words long, then replaced the spaces with a delimiter. The delimiter can be anything you want. I chose <+>. Then I made this simple macro, which operates in a fraction of a second on my PowerBook. Is this what you're looking for?

Choose random word Macro (v9.0.5)

3 Likes