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 ?
-
Use
For Each File in Folder
Activity: This activity allows you to loop through each file in a specified folder. -
Use
Rename File
Activity: Within the loop, use theRename File
activity to rename the file as per your requirements.
Welcome to the community
Yes you can do in one
- Use for each file in folder
- Use a switch case or if else condition to check the extension
currentfile.Extension.contains("pdf")
…similarly for other file types - Now inside each condition use a rename file activity specific to that extension
Cheers
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!!
Please refer the below code which is working as expected. You can modify based on your requirement
FileRenaming.zip (95.1 KB)
Thank you everyone, Your help was greatly appreciated!
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.