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
Super User
Super User

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
Super User
Super User

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"

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

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,023)