Select set of files

Hello

I am trying to select 1000 files from a set of 300,000. It is not a specific file type i need i just want to select a certain number of files then copy them to a new location.

 

So in total i am trying to select small number of files from a larger set then copy/move those files into another location i then would like to repat this until all the files have been copyed/moved into seperate folder and then inturn to run a batch file at each of the folders which will then put its output into a different folder with a similar name as the folder from which they were taken.

 

My rough idea of how it could work would be to create "counter" variable which auto-increments a +1 to its value every time a file is copyed from the main location, then once this variable = 1000 it would exit the loop and then run the batch against the folders its created.

 

I am however having issues

 

Could anyone help me out?

 

Regards

 

Cawston

 

 

Hi Cawston

I have attached a small example project that demonstrates a method of doing this. I use a file set to define the total set of files (100 files in total). I then use a FileSet iterator to loop through the files and move them to a seperate directory. I use a counter to limit the iterator to only run 10 times, before the iterator is exited and a batch file is run (which performs a directory listing of the files that were moved and then deletes the files).

Once the batch file is run, the FileSet iterator runs again (refreshing the FileSet values, to discard the files that were moved in the last batch) and the process continues until there are no files left in the source directory.

I have commented the project to explain each step of the process. Let me know if you have any questions or need any further assistance with this.

Hope this helps.

Regards,
Steve

SelectSubsetFiles.zip (23.94 KB)

Hi Stephen

Thanks so much for this it really steered me in the right direction.

Regards

Jack

No problems. Let me know if you need any further help with any of this.

Regards,
Steve