Copy a file and rename the file before adding to the folder

I need help with this issue…

1 - Copy a file (from a specifik folder)
2 - Change file name add to another folder

how can i do that in one time like can i copy and change name and add in one step?

write now im doing in 3 parts…
copy file, rename file and add to the folder … is there a way to do in one part?

Hi @Ellen

You can simply use Copy File activity

image

Cheers!!

kindly read my question again.

@Ellen

You want to copy the file from one folder to another folder before adding to other folder you need to change the file name. If that is the case the below will works!!

image

Please check below for reference

From:
“C:\Users\lrtetala\Documents\UiPath\BlankProcess20\Data\Input\Source File.xlsx”

To:
“C:\Users\lrtetala\Documents\UiPath\BlankProcess20\Data\Output\Destination.xlsx”

Input:(From)

Output:(To)

Cheers!!

@Ellen

check the reference

Thanks for the help. issue solved.

1 Like

how do i get the file name out after renaming in that way?

image

Im creating a folde with date and time
Then Im using the copy file to copy a file rename it with (file name + date and time like. Test-03-04-2024 07.50.52.xlsx)

Now how can i get the perticular file name out so that i can use WriteRange activity to add a datatable value to it.

The code which you have return in “To” Value take a assign activity above copy file activity then create a string variable.

FinalFileName = (file name + date and time like. Test-03-04-2024 07.50.52.xlsx)

then, put above variable in copy file activity “To” - Value & then same in write range also.

I hope this will resolve your issue, if yes then please mark this as a solution.

Thanks,
Ajay Mishra

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