Help! How can I change the multiple file name one by one?

Hello,
Please help me.Suppose I have folder it’s in 5 (*.excel) files and have a excel in the file list name. Now I want to change the file name one by one and root file have still there. Create new file name Which file will be rename . Please give me solution with a .xml file.

Thanks,

Hi @razu91

You might want to use foreach loop and in that loop you can use “copy file” activity.

Hope this helps! :slight_smile:

Fine to rename the files in a folder
— use a assign activity like this
Out_Filepatharray = Directory.GetFiles(“yourfolderpath”,”*.xlsx”)

Where Out_Gilepatharray is a variable of type string array which will have file path of all excel files in that folder
— use a for each loop and pass the above variable as input and change the type argument as string the property Panel of for each loop
— inside the loop use a activity called MOVE FILE ACTIVITY where in the source path mention the value as item (the variable from for each loop which has the source file path) and destination property with file name you want to save with (mention with filepath as well to save the new mentioned file name)

For more info on that activity
https://activities.uipath.com/docs/move-file

Cheers @razu91

Hello Palaniyappan,
Thanks, Can you please upload any sample .xml file?
Please check my code according to your instruction…

Like root file name test.xlsx(This is dynamic name it’s change will one by one according to list) and rename file name should be robot.xlsx .And open this robot.xlsx file.Its continue one by one from my list.

Code:FileNameChange_Raj.xaml (5.9 KB)
Please bro give me the sample code of my solution.

Note: You was fixed my another problem a few days ago and with that I proceeded a long way.Thanks for your great help.