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 File - Remove C...
Power Automate
Answered

Rename File - Remove Characters

(0) ShareShare
ReportReport
Posted on by 22

Hello,

I have over 30 files I download daily into 1 folder that all have different names. I need to remove the last 13 characters on each file name, so from the dash to the end. I just don't know what to put in "text to remove". Everything I've tried gives me an error. Is this possible?

For this example I just need it to be ABCDE Test and FGHIJ Report.

marksben32_0-1713211233330.png

Any help is greatly appreciated. Thanks in advance!

I have the same question (0)
  • Verified answer
    Srini007 Profile Picture
    3,463 Super User 2026 Season 1 on at

    Hi @marksben32 

     

    Try as below

     

    Srini007_0-1713213439908.png

     

     

    Folder.GetFiles Folder: $'''D:\\Test_String''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files3
    LOOP FOREACH CurrentItem3 IN Files3
     IF Contains(CurrentItem3, $'''-''', False) THEN
     Text.SplitText.SplitWithDelimiter Text: CurrentItem3 CustomDelimiter: $'''-''' IsRegEx: False Result=> TextList
     File.RenameFiles.Rename Files: CurrentItem3 NewName: TextList[0] KeepExtension: True IfFileExists: File.IfExists.DoNothing RenamedFiles=> RenamedFiles
     END
    END
    

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Cheers,

    Srini

  • marksben32 Profile Picture
    22 on at

    That worked! Thank you so much!

  • Verified answer
    Srini007 Profile Picture
    3,463 Super User 2026 Season 1 on at

    Hi @marksben32 

     

    If the above post resolves your issue, then click on ACCEPT AS SOLUTION , so that it will helpful to others

     

    Cheers,

    Srini

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard