How to randomly select files in batches ?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
shazoo
Junior Member
Junior Member
Posts: 2
Joined: 2025-02-10, 09:50 UTC

How to randomly select files in batches ?

Post by *shazoo »

Hi, I regularly need to copy a large number of files from a source directory to a target directory—usually around 5,000 to 8,000 files. The source directory typically contains about 50,000 files.

When copying, I want to randomly select files in batches, similar to a "RandomSort" feature.

I came across some old forum posts (many thanks to the posters for their generous sharing). I really like their approach: add a new column containing random values, then sort by that column and manually select the number of files I need. I also tried downloading some of the plugins mentioned in those posts, but they’re a bit outdated—some are not compatible with the newer 64-bit version of Total Commander, and a few of the download links are broken.

Could you help me out? This could significantly speed up my workflow. (For now, I’ve written my own Python script to do this.)

Alternatively, is there a way to add a column that automatically calculates the MD5 hash of the filename? That would also help me achieve my goal.

Thanks
User avatar
beb
Power Member
Power Member
Posts: 596
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to randomly select files in batches ?

Post by *beb »

shazoo wrote: 2025-07-01, 01:58 UTC is there a way to add a column that automatically calculates the MD5 hash of the filename? That would also help me achieve my goal.
2shazoo
Yes, it is possible for the file contents.
Use LotsOfHashes wdx plugin and add a custom columns set with [=lotsofhashes.MD5.Lowercase], like this:

Code: Select all

Headers [Contents] 
Name
Ext
Date [=tc.writedate.Y-M-D h:m:s]
Size [=tc.size.bkMG3]
md5 [=lotsofhashes.MD5.Lowercase]
However, it's not possible in TC if you literally mean md5 of a filename, i.e. md5 of a string entity whose value equals the name of a file. At least, as far as I know, there are no plugins for that around there.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 16
User avatar
Dalai
Power Member
Power Member
Posts: 10043
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: How to randomly select files in batches ?

Post by *Dalai »

2shazoo
You could use the field tc.random number (internal TC plugin). Please note that this field's content will refresh when refreshing the file list, but that's probably what you want to achieve.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply