Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Power Automate Desktop
Suggested answer

Moving specific files from one folder to another

(1) ShareShare
ReportReport
Posted on by 38
  This process needs to look at a files in a folders on a Windows server. I believe this requires the Power Automate Desktop..
 
Step 1
In Folder 1 - Examine each file name for the pattern “C” followed by 4 numerics, example (dog-C0001-20240101)
 
Step 2
If file name in Folder 1 matches this pattern then move the file to Folder 2  
 
Categories:
  • Suggested answer
    eetuRobo Profile Picture
    eetuRobo 2,863 Super User 2025 Season 1 on at
    Moving specific files from one folder to another
    First use Get files in folder -action to get all files from Folder 1. You can have it retrieve only files that contain character c in them with *c*. 
    Then loop those files to check if they have the pattern you want. You can use Parse Text and regular expression in that.
    Regular expression for the pattern C followed by 4 digits: C\d{4}
    Then if no match was found don't move file but just go to the next loop. If match was found then use Move file(s) to move the currently looped file to Folder 2.

    For example:
    Highlighted has the correct pattern so those would be moved to folder two:


    Flow:


    result in folder two:


    Folder 1 has only the 4 files left that did not match C + 4 digits:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,318 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,111 Most Valuable Professional

Leaderboard