Randomizing a list

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
utz
Newbie
Posts: 18
Joined: Sat Aug 11, 2007 8:33 pm

Randomizing a list

Post by utz » Fri Feb 29, 2008 7:54 pm

Hello everyone,

I hate to reinvent the wheel. Does anyone happen to have a list-randomization function you'd be willing to share? I'd like to pass it a CRLF-delimited text file and get another file back with the same lines but in a random order. I could use an array-randomization function instead of what I just described, of course.

Thanks for any help you can provide,
Utz

utz
Newbie
Posts: 18
Joined: Sat Aug 11, 2007 8:33 pm

Got it...

Post by utz » Sat Mar 01, 2008 12:21 am

I found a VBscript solution here:

http://vb-helper.com/howto_randomize_list.html

As the author says, "For each item, the algorithm randomly selects an item at that position or later in the array and swaps the two. This produces a randomized list."

So there you go.

Thanks,
Utz

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts