ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Move/Organize Files Into Folders

<< < (2/3) > >>

skwire:
Apologies, Nick, I got completely sidetracked.  Did you still need this?

nkormanik:
Skwire, if you want to make it.  Surprisingly dividing a sorted collection into sets, say, by size, is lacking presently.  Go figure.  I'd think there would be a desire to have such functionality.

There IS the ability to separate based on other criteria, such as extension.  I think you yourself made such a program already.

MilesAhead:
I notice MultiCommander has updated the online documentation.  There are step by step instructions for creating user defined commands etc..  One of these days I have to play with it in depth as it is supposed to have 64 bit builds with true multi-threading.

http://multicommander.com/docs

Lintalist:
I don't know if you are familiar with AutoHotkey, a useful script language, you can find it here http://autohotkey.com/

This script should work (be sure to make a backup and be careful which folders you use)

The DIR command (MS Dos) has a useful SORT by size option so we make use of that to create a list of files sorted by size first, then read the list and parse it and create the folders when we need them to move the files into it. Again use at your own risk and be careful which folders you try it out on. You can compile this script into a exe and also have it read some settings from an INI file if that is useful by using the AutoHotkey IniRead command. You can also dress it up with a GUI and progress bars and what not, this is just a bare bones script.


--- Code: Autohotkey ---#NoEnv#SingleInstance, forceSetBatchLines, -1SetWorkingDir, %A_ScriptDir% Counter:=0FilesPerFolder:=100Folder=c:\test\ ; set folder here or uncomment the lines below by removing the ; so you can select a folder ;FileSelectFolder, Folder, , 0, Select folder;If (Folder = "");       ExitApp Folder:=RegExReplace(Folder, "\\$") ; make a list sorted by size, type DIR /? at a command prompt for more options.RunWait, %ComSpec% /c dir %Folder% /b /OS > $$filelistsortedbysize.tmp, , Hide ; use /O-S if you want to sort from large to smallFileRead, FileList, $$filelistsortedbysize.tmpSleep 100 TargetFolder:=SubStr("00000" ++Counter, -4)FileCreateDir, %Folder%\%TargetFolder% Loop, Parse, FileList, `n, `r        {         ; MsgBox %Folder%\%A_LoopField%`n%Folder%\%TargetFolder% ; debug msgbox so we can see what is going on         FileMove, %Folder%\%A_LoopField%, %Folder%\%TargetFolder%         If (Mod(A_Index,FilesPerFolder) = 0)                {                 TargetFolder:=SubStr("00000" ++Counter, -4)                 FileCreateDir, %Folder%\%TargetFolder%                }        } FileDelete, $$filelistsortedbysize.tmp MsgBox Done! ; Esc::ExitApp ; if you want to be able to stop the script at any time by pressing Esc remove the ;

nkormanik:
Thanks Lintalist, a lot of work you put in there.  Seems to do the job as advertised.

Skwire, unless you or someone else wants to add anything, this one looks solved.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version