Hello people, I am new to uipath studioX and I would like to rename the files dynamically like “file_v01_yyyymmdd.xlsx”, “file_v02_yyyymmdd.xlsx” and etc. Currently, when I rename the file name it will give an error saying “it cannot create the file that is already exist although the date in the filename is different”. I saw a solution on this problem in studio and I try to apply in using the text function in studioX but it’s not working as it intended. Hence, I would like to seek some help here.
Thank you in advance !
Welcome to Community,
First you need to get your file name from the path.
then You can use “YourPath”+“YourFileName” +datetime.now.tostring(“yourdesiredformat”) +".xlsx"
@sb001 and @suraj.setty thank you so much for the response. But I want the v01 and v02 to change dynamically like a version to indicate which file is the latest downloaded one.
I tried both of your solution @sb001 and @suraj.setty but it did not work. I get error message saying “Illegal characters in path”.
If you want to know the latest file that has been downloaded you can use the
“YourPath”+“YourFileName” +datetime.now.tostring(dd_MM) +".xlsx"
Which will include the complete timestamp , so each file will have the unique timestamp attached to it ,try this
The file is actually a newly downloaded attachment from email. Then I would like to change the filename to a readable one and also to distinguish the newly downloaded file. I used the notebook in studioX to reformat the filename like this “filename_yyyymmdd.xlsx”. Every month I will download the file and whenever it runs it will overwrite the previously downloaded file although the datetime is different. If I unchecked the overwrite option, it will prompt an error saying the file already exist. Do you have a solution for this problem ?
before write the file check the file is already existing with same name
Can you please share screenshot of this error and the file name you have tried?
Add Time Stamp to your File like
So, it will uniquely identify file name Every time it Downloaded.
Image 1 - Error message
Image 2 - I tried the solution you suggest and I get the error message show in image 1
Please guide me on this I’m not sure what or where went wrong.
So you want to rename file while Downloading it from email Right? (Using Studiox)
Can you share screenshot of your code?
Hi @sb001, yes I want to rename file while downloading it from email.
Sorry I can’t share screenshot of my code due to certain policy.
However, I have outline my code as shown below. If you are unclear about anything feel free to ask me.
This project is fully implemented using studiox.
Can you use rename file activity instead of move file and try Once.
I can’t find rename file activity in my studioX.
I can see that in my StudioX.
I can’t find it in my studioX. I only have rename excel sheet. My friend have it too but I can’t find it in my studioX. I have already uninstalled my studioX and reinstalled again yesterday but I still couldn’t find rename activity in my studioX.
u can see rename file activity by enabling classic filter
as shown in figure above
As shown in the figure, I don’t have ‘Show Classic’ option in the filter.
Can you Check once by upgrading uipath.system.activities and uipath.excel.activities Package versions.