Sign in to follow this  
Followers 0
bobneumann

Sorting Files: Looking for a general approach

5 posts in this topic

I have a folder on a Win2k server containing 2.4 million files. I'd like to run a script that will go through the files, create subdirectories, and put those files into subdirectories, about 5000 or so per directory. The directories would be named serially.

Any quick advice on the best general way to approach this problem?

Thanks in advance,

Bob

Share this post


Link to post
Share on other sites

My advice, fire the guy who put 2.4 million files into one folder.

Share this post


Link to post
Share on other sites

I have a folder on a Win2k server containing 2.4 million files. I'd like to run a script that will go through the files, create subdirectories, and put those files into subdirectories, about 5000 or so per directory. The directories would be named serially.

Any quick advice on the best general way to approach this problem?

Thanks in advance,

Bob

You can still use _FileListToArray() and walk the resulting array to process the list. An AutoIt array can have up to 2^24 (16M) elements. You're not even up to 2^22 yet!

If you just want to take them in batches of 5000 without any further logic, then FileFindFirstFile/FileFindNextFile might be even more straight forward.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I think he took my advice and fired himself! Sorry.

Share this post


Link to post
Share on other sites

I think he took my advice and fired himself! Sorry.

I hope he gave himself severance pay and a polite referral letter.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0