Renaming Files inside the folder with different extension

I want to rename files inside the folder and inside the folder I have 2 docx, 2 excel file and 2 ppt. I want to rename those 6 files with different naming file. I want to do it in one run is it possible ?

@_Rinkashime,

  1. Use For Each File in Folder Activity: This activity allows you to loop through each file in a specified folder.

  2. Use Rename File Activity: Within the loop, use the Rename File activity to rename the file as per your requirements.

1 Like

@_Rinkashime

Welcome to the community

Yes you can do in one

  1. Use for each file in folder
  2. Use a switch case or if else condition to check the extension currentfile.Extension.contains("pdf") …similarly for other file types
  3. Now inside each condition use a rename file activity specific to that extension

Cheers

1 Like

Hi @_Rinkashime

Use For each file in folder activity to loop through all the files in the folder.

Then use if condition or switch activity to sort three extensions using currentfile.Extension.contains("pdf") … similarly for others.

Use rename file activity to rename the file name as per required.

Thanks!!

1 Like

Please refer the below code which is working as expected. You can modify based on your requirement

FileRenaming.zip (95.1 KB)

1 Like

Thank you everyone, Your help was greatly appreciated!

1 Like

Kindly close the topic by marking the solution if it helped you to sort the issue.

Thank You and Happy Automation

I have a follow up question, I want to remove the currentFile name the one highlighted and rename it new, what kind of approach do I need to do ?

I try removing the CurrentFile. Name but its stop running.

You can refer the same code only. You can give any new name. In my code - i have appended the existing code. Remove that part and the result will match your expectation

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.