How to automatically split a large folder into sub folders containing 2000 files?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
fliptoback
Junior Member
Junior Member
Posts: 13
Joined: 2019-05-15, 12:23 UTC

How to automatically split a large folder into sub folders containing 2000 files?

Post by *fliptoback »

Hi,

I am dealing with a large photo folder and wanted to split this folder into sub-folders each containing no more than 2000 files. How do I use TC to automatically do this?

I searched the internet and checked this forum but could not find relevant hits.

Any ideas?

Thanks
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: How to automatically split a large folder into sub folders containing 2000 files?

Post by *nsp »

With TC as you do not have math operator with counter nor additional variable it could be quite hard to find a solution.
The best would be to use Total Commander to sort and select all the files you want to move into sub folder and then use a scripting language to :
count files 1 by 1,
create folder (modulo 2000) and increase folder name,
move file to current folder

This can be done with powershell, dos script with TCBL, ...
fliptoback
Junior Member
Junior Member
Posts: 13
Joined: 2019-05-15, 12:23 UTC

Re: How to automatically split a large folder into sub folders containing 2000 files?

Post by *fliptoback »

Thank you nsp for your reply.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to automatically split a large folder into sub folders containing 2000 files?

Post by *Stefan2 »

The forum contains already many solutions, a few are...


Kopieren einer vorgegebenen Anzahl von Bildern in neue Ordner
https://www.ghisler.ch/board/viewtopic.php?p=383314#p383314
Plugin "Mover" and VBScripts
and Ghislers' Mehrfach-Umbenenntool-Trick:
5. Geben Sie folgenden Umbenenntext an anstelle von [N]:
Ordner[C+1/406:2]\[N]



How to select the first 1000 or 900 files?
Select-Amount-Of-Files AutoHotkey
viewtopic.php?p=307215#p307215



AutoHotkey: Select first n files, Select every n'th file
viewtopic.php?p=298324#p298324
With Romans' simple AutoHotkey-Script:
WinActivate, ahk_class TTOTAL_CMD
WinWaitActive, ahk_class TTOTAL_CMD
; cm_GoToFirstFile
PostMessage, 1075, 2050
SendInput, {Insert 2000}


Not sure if one or another works for you or are a starting point....
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: How to automatically split a large folder into sub folders containing 2000 files?

Post by *Gral »

1. Sort files with desired order - by name or time or any other.
2. Select all files - CTRL+A
3. Start Multi=Rename Tool with default settings - CTRL+M
4. Prepend filename with

Code: Select all

[C+1/2000]
so you get in "Rename mask: file name"

Code: Select all

[C+1/2000]\[N]
5. Press "Start"

If you wish folder names with fixed chars length {with leading zero(s)} change this to e.g.

Code: Select all

[C+1/2000:5]\[N]
where "5" is number of digits.

This way you get EXACTLY 2000 files in each subfolder (probably except the last one).
Post Reply