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 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,327 Super User 2025 Season 2 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,327 Super User 2025 Season 2 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

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard