Jump to content

Sorting Files: Looking for a general approach


Recommended Posts

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

Link to comment
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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...