cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jamy123
New Member

Move only x number of file at a time

I cannot for the life of me get this to work and I think I'm missing something simple. 

 

I have a folder that has lets say 2000 files in and I want to move only 200 files from folder 1 to folder 2 at a time.

 

I can get files to move from folder 1 to folder 2 no bother at all - but cannot get it to limit the number of files that move.

 

I've tried loops - incremental variables - I've tried replicating a script from Automate 11 -but its just not working 🤦‍♂️

 

Any advice/guidance would be greatly appreciated,

 

Thankyou 🙂

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highboy
Skilled Sharer
Skilled Sharer

You could do it the simple way


Folder.GetFiles Folder: $'''c:\\temp''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
LOOP LoopIndex FROM 0 TO 3 STEP 1
File.Move Files: Files[LoopIndex] Destination: $'''c:\\test''' IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
END

 

Or you could put the first 200 files into a new list and use it in "Move files"

View solution in original post

2 REPLIES 2
Highboy
Skilled Sharer
Skilled Sharer

You could do it the simple way


Folder.GetFiles Folder: $'''c:\\temp''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
LOOP LoopIndex FROM 0 TO 3 STEP 1
File.Move Files: Files[LoopIndex] Destination: $'''c:\\test''' IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
END

 

Or you could put the first 200 files into a new list and use it in "Move files"

View solution in original post

Thankyou! Knew it would be something stupid I was missing! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,578)