Utility to sort files?

T

Tom McDonald

Does anyone know of a program that will take a folder of ten thousand
files, and sort it into ten subfolders of a thousand files each? I've
found programs that will sort based on output folder size, and one that
will sort into alphabetical folders, but nothing that will sort based on
number of files. Any suggestions will be appreciated.
 
B

B. R. 'BeAr' Ederson

Does anyone know of a program that will take a folder of ten thousand
files, and sort it into ten subfolders of a thousand files each? I've
found programs that will sort based on output folder size, and one that
will sort into alphabetical folders, but nothing that will sort based on
number of files. Any suggestions will be appreciated.

You can use xxcopy to restrict your move process to a file number:

http://www.xxcopy.com/index.htm

Because xxcopy does not allow looping to several subdirectories on file
count itself (it only breaks after a given file count is reached), you
have to embed xxcopy into a For-Loop or similar. On Win2k or WinXP you
could switch to the directory containing your files and run the following
command line:

cmd /c for /L %i in (1,1,10) do xxcopy * DIR%i /mdDIR%i /QF1000 /RC /YY

It assumes that you installed xxcopy somewhere in your search path. Else
you have to add the full path to xxcopy. You can adjust the /QF switch
if you need another count than 1000 files per subdirectory and number
10 inside the brackets to change the number of loops.

BeAr
 
T

Tom McDonald

You can use xxcopy to restrict your move process to a file number:

http://www.xxcopy.com/index.htm

Because xxcopy does not allow looping to several subdirectories on
file count itself (it only breaks after a given file count is
reached), you have to embed xxcopy into a For-Loop or similar. On
Win2k or WinXP you could switch to the directory containing your files
and run the following command line:

cmd /c for /L %i in (1,1,10) do xxcopy * DIR%i /mdDIR%i /QF1000 /RC
/YY

It assumes that you installed xxcopy somewhere in your search path.
Else you have to add the full path to xxcopy. You can adjust the /QF
switch if you need another count than 1000 files per subdirectory and
number 10 inside the brackets to change the number of loops.

BeAr

Thank you for this excellent and much-appreciated suggestion. Generally,
I have the same enthusiasm for the command line as I do for tightrope
walking, and this was a bit alarming, when it seemed to be deleting ten
thousand files. However, I had made a backup before testing, so I sat
back and enjoyed the show. It did the trick, and it's saved me quite a
bit of work. I'm also grateful for your pointing out how the command can
be modified for other situations.

I may observe that this is the first time that I've gotten xxcopy to do
anything useful for me, the difference being that I didn't try to write
the commands myself!

Thank you again for your time and assistance.
 
B

B. R. 'BeAr' Ederson

I may observe that this is the first time that I've gotten xxcopy to do
anything useful for me, the difference being that I didn't try to write
the commands myself!

Maybe you should use this sample as a start to try other usages yourself?
If you didn't already download the Technical Reference get it from here:

http://www.xxcopy.com/index.htm#tbul

You should download the combined version [Zipfile (for Download)]. But,
IMHO, the most important part is Bulletin XXTB #01. It is split into
sections like this:

------------- Some switches for alike purposes ---------------------

So you can skip quickly all sections targeting an area of usage you
don't need at the moment. Be sure to test your command line against
sample data and always keep a backup of data until a task is
(successfully) accomplished. - As you did with my suggestion. ;-)
Thank you again for your time and assistance.

Glad it worked for you!

BeAr
 
L

laurent

B. R. 'BeAr' Ederson said:
I may observe that this is the first time that I've gotten xxcopy to do
anything useful for me, the difference being that I didn't try to write
the commands myself!

Maybe you should use this sample as a start to try other usages yourself?
If you didn't already download the Technical Reference get it from here:

http://www.xxcopy.com/index.htm#tbul

You should download the combined version [Zipfile (for Download)]. But,
IMHO, the most important part is Bulletin XXTB #01. It is split into
sections like this:

------------- Some switches for alike purposes ---------------------

So you can skip quickly all sections targeting an area of usage you
don't need at the moment. Be sure to test your command line against
sample data and always keep a backup of data until a task is
(successfully) accomplished. - As you did with my suggestion. ;-)
Thank you again for your time and assistance.

Glad it worked for you!

BeAr


A little out topic remark, because i have just read about
the ability to clone the system partition with XXCOPY, and
despite it seems easy, it is not so easy as with linux and
the dd command : i did just run *once* (no need of sereval
pass) : dd if=/dev/hda1 of=/dev/hdb1, and soon
i had a bootable harddrive. With a wrong size, but i could
adjust it with PM. And had a huge defragmentation to do
(drawback of that raw copying proces, but maybe if
one set a right count b=1, 4, it's better)


lh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top