ZTree.com  | ZEN  | About...  

 Index   Back

[Q] Sort files into random sequence?   [Q]

By: Ben Kent       
Date: Dec 21,2010 at 02:44
In Response to: [Q] Sort files into random sequence? (Leonard R. Miller)

> I have a list of files which I want to copy to another drive. But I
> want them to have a random sequence and I see that Ztree doesn't offer
> that.
>
> I've thought of tagging and copying my list into Excel (well --
> OpenOffice Calc), add a column of integers created by a random function,
> then sort by that column. From there, copy the list (less the integers)
> to a text file and use Ztree's batch creation ability (I'd have to ask
> how to do that) to do the end result.
>
> However, I've tried OpenOffice Calc formula as follows
> =RANDBETWEEN(1;10), placing into each cell of the column and get a random
> number in each of the 10 cells but, more often than not, there are
> duplicates.
>
> Any way I can generate a list of unique integers?
>

I don't think there is a easy way, but for what you need why not just up the range =RANDBETWEEN(1;1000)?

And anyway a few duplicates does not mean the set is not random, you are suffering from the human pattern finder. It sounds like you are looking for a set that has no pattern, but having a pattern does not mean it's not random, it is perfectly possible that a randomly generated sequence could be a list of numbers that increment.

I'm assuming that you want the files copied in random order.

For automating the copy process, I would create the batch file from Calc, get your random list, then build batch files lines, with formula's like this (Excel syntax)

="Copy ""d:\dir\" & A1 & """ ""e:\dir\*.*"""

then copy the lines to the batch file and execute.

But depending on the destination file system you might be wasting your time, for example NTFS uses directory structures that are based on B-tree structures, which inherently sort the entries.

Ben

880 views      
Thread locked
 

Messages in this Thread

 
95,888 Postings in 12,107 Threads, 350 registered users, 22 users online (0 registered, 22 guests)
Index | Admin contact |   Forum Time: May 23, 2022 - 5:54 pm UTC  |  Hits:48,180,109  (13,427 Today )
RSS Feed