web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Rename files using reg...
Power Automate
Unanswered

Rename files using regex in PAD

(1) ShareShare
ReportReport
Posted on by 16

Hi guys,

I have a folder with the following files that are downloaded from a website. After download the files should be renamed to the following. 

 

abc_123cl_20230412_w_get_summary.xls should be renamed to "abc_123cl.xls"

red_venxb123_20230412_w_get_summary.xls should be renamed to "red_venxb123.xls"

ere_123ng_20230412_w_get_summary should be renamed to ere_123ng.xls

 

Basically "_20230412_w_get_summary" should be removed from the name as this changes with the date.

 

Appreciate the help.

 

Thanks

E2

 

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @v2 

     

    Does that date would be current date or something like that ?

  • Verified answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @v2 

     

    You can give a try like this as well using regex 

    Nived_Nambiar_0-1681555375577.png

     

    Nived_Nambiar_1-1681555388372.png

     

    Nived_Nambiar_2-1681555401063.png

     

    Input file for testing: 

    Nived_Nambiar_3-1681555420868.png

     

    Output file after renaming

    Nived_Nambiar_4-1681555445802.png

     

     

    Hope this helps 

     

  • v2 Profile Picture
    16 on at

    Hi Nived,

     

    The date will vary and is based on a date the analysis is done.

     

    thanks

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @v2 

     

    If the filename format follows that , then try with regex pattern which i have suggested 🙂

     

    Hope that helps 🙂

  • v2 Profile Picture
    16 on at

    Perfect Nived. Thanks a lot.

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Did it worked?

  • v2 Profile Picture
    16 on at

    yes it did Nived. thanks

     

    Do you mind explaining what the regex characters mean and how you got it to exclude?

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Sure. the regex pattern _\d{8}_w_get_summary  checks for string which has underscore then followed by 8 digits then underscore followed by w_get_summary

     

    \d{8} , represent regex pattern that searches for a number with 8 digits.

     

     

    Hope it helps 

     

    Mark it as solution if it resolves your query 🙂

  • CU02081325-2 Profile Picture
    on at
    @Navid Nambiar
     
    I have the same exact issue but I cant view any of your solution screenshots. Can you report please?
    Where do you insert the regx expression? 
     
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    Try this
     
    _\d{8}_w_get_summary
     
     
    This helps !
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard