05-05-23 07:13 AM
Hi,
There are some files in a folder. I need to rename the file with today's date (For example: 05.05.2023_File Name). So, I used "copy file" to copy the file with new name. Then I used "delete file" to delete the old file. And finally, I used "move file" to move the file to another folder. Unfortunately, copy and move file do not work in my workflow. But delete file is working. Can anyone tell me where is the problem?
Answered! Go to Answer.
05-05-23 09:50 AM
Hi @Ekram Shihab - You can use both options - Copy File & Move File to Copy and Rename but you would have give proper name and extension - let's say for example - I wanted to move a Test.PDF from Folder A to Folder B and wanted to rename this file to Test2.PDF - I would do so by using Move File (If I don't want a copy in the original file location/wanted to delete the original file) or Copy file (If I want to have a original file in the source location or original file location):
------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.
Regards,
Mukesh Kumar - Senior Automation Developer
NHS, England, United Kingdom, GB
------------------------------
05-05-23 08:16 AM
HI Ekram Shihab,
Looks like the destination path was incorrect you just need to give the foldername inthe destination path instead of giving the path including the filenam
It should be some thing like below.
"C:\***************\project 1\saved email"
05-05-23 09:04 AM
The thing is that I need to rename the file name. But there is no option to rename the file in Utility- File Managemement. That's why I tried to rename the file using "copy file". What I understand from your information is that using "copy file", I cannot rename the file. Is this right?
05-05-23 09:50 AM
Hi @Ekram Shihab - You can use both options - Copy File & Move File to Copy and Rename but you would have give proper name and extension - let's say for example - I wanted to move a Test.PDF from Folder A to Folder B and wanted to rename this file to Test2.PDF - I would do so by using Move File (If I don't want a copy in the original file location/wanted to delete the original file) or Copy file (If I want to have a original file in the source location or original file location):
------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.
Regards,
Mukesh Kumar - Senior Automation Developer
NHS, England, United Kingdom, GB
------------------------------
05-05-23 10:02 AM
Also for adding date to the new file name - I would create an expression like this and put this new file name along with the destination folder path * (Date “/“ can be replaced by “_” or “” to follow naming standards, Just put replace outside of below expression again and give arguments - Save this whole expression to New File Name Data Item -
see below for expression:
05-05-23 12:04 PM
For adding date with the file name, I created a data type as text. Then using calculation, I have found out the date and stored in the text data type.