Hi there,
I want to add timestamp and file extension to the file and eventually move to the Archive Folder…Can anyone advise, please?
I look forward to your response
Hi there,
I want to add timestamp and file extension to the file and eventually move to the Archive Folder…Can anyone advise, please?
I look forward to your response
Hi @Sisay_Dinku,
Use move file activity
In destination use below format to add timestamp
"C:/arivu/Archive/RPA"+DateTime.Now.ToString("HHmmss")+".xlsx"
Regards,
Arivu
I want to dynamically pass and the eventually the file would look like for example → RPA 12-11-2022.xlsx
Hi @Sisay_Dinku ,
Try below code
"C:/arivu/Archive/"+Path.GetFileNameWithoutExtension(item.ToString)+DateTime.Now.ToString("MM-dd-yyyy")+".xlsx"
Regards,
Arivu
Thank you for the effort.
I got the following error
I think I have to do a couple of things
Q: Where should I make these changes? Is it before moving at the current location and moving after the renaming has been done?
Sure.
item+Path.GetFileNameWithoutExtension(item.ToString)+DateTime.Now.ToString(“MM-dd-yyyy”)+“.xlsx”
Hi @Sisay_Dinku ,
try to mention the correct path , where you need to save
item+Path.GetFileNameWithoutExtension(item.ToString)+DateTime.Now.ToString("MM-dd-yyyy")+".xlsx"
in above syntax “item” is full path of your source file path, so provide the destination folder path
Regards,
Arivu
str_archivePath location? its inside the project folder ?
try below
str_archivePath - assign in which folder you need to save and use below syntax
str_archivePath+Path.GetFileNameWithoutExtension(item.ToString)+DateTime.Now.ToString("MM-dd-yyyy")+".xlsx"
Regards,
Arivu
No, the folder is NOT inside the project folder.
I am able to send to the archive folder the existing folder. However, the issue I have is with renaming and adding time stamps and sending them to the archive folder.
Hi Team,
Can anyone help with this?
Here is the folder path, where I want to store the processed files
Hi @Sisay_Dinku ,
You are almost there. The “From” value being passed to the Move file activity is correct!
All you need to do it put the full new path in the “To” value of the move file activity:-
Path.Combine(str_ArchivePath, Path.GetFileNameWithoutExtension(item.ToString)+DateTime.Now.ToString(“MM-dd-yyyy”)+“.xlsx”)
Thank you and this one worked out. I appreciate that @pradumn30
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.