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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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

 

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @v2 

     

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

  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 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,138 Super User 2026 Season 1 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,138 Super User 2026 Season 1 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,138 Super User 2026 Season 1 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,138 Super User 2026 Season 1 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard