File Rename with Current Date

Discuss RoboTask here
Post Reply
waldo
Posts: 56
Joined: Fri Sep 24, 2004 3:36 am

File Rename with Current Date

Post by waldo »

I have a pdf report that is created nightly by RoboTask and is saved to:  C:\My Documents\dailystats.pdf
I need to move this file to a network drive but re-name it so that I keep an accumulation of the the report.  I would like to concantenate the current windows system date to the end of the file name [i.e. dailystats200709014.pdf  Once the file is renamed, it would be moved to the following drive/folder: G:\operate_stats\
Can the rename process described above be done through the file rename function in robotask or does this need to be accomplished through an external script?  If it is script, can you provide one or point me in the right direction?  THANKS.
 
 
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

File Rename with Current Date

Post by Oleg »

Let's divide this task onto small parts.

1 Rename file. You ca do this by using {ExtractFileNameNoExt()} variable
{ExtractFileNameNoExt(C:\My Documents\dailystats.pdf)}{Year}{MonthNo}{Day}.pdf

2. Move file to another location. See "Copy/Move"

I recommend you use the following algorithm

set user variable NewFileName to {ExtractFileNameNoExt(C:\My Documents\dailystats.pdf)}{Year}{MonthNo}{Day}.pdf
rename C:\My Documents\dailystats.pdf to {NewFileName}
move file {NewFileName} to G:\operate_stats\

If needed I can write an example, but I think that you easily can do this yourself.
waldo
Posts: 56
Joined: Fri Sep 24, 2004 3:36 am

File Rename with Current Date

Post by waldo »

Oleg,
Thanks..I will work on this over the weekend and post back if I cannot complete your suggestion....again, thank you for the reply.  Take care.  
waldo
Posts: 56
Joined: Fri Sep 24, 2004 3:36 am

File Rename with Current Date

Post by waldo »

Oleg,
One more question...where do I find a list of the commands and variables and their syntax, like the ones you used in your post.  I think that these are  Windows operating system variables, but I have no idea how you secured them [ {ExtractFileNameNoExt}  {Year} ,etc.  This list would be very helpful to me.  Sorry if this is a "dumb" question.  Thank you. 
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

File Rename with Current Date

Post by Oleg »

It's very simple.
Open menu Options | Variables and you can see all system and user variables. Each system variable have short description. All system variables are divided for a few groups. I think that you need a very little efforts to learn more about existing system variables.
Also each action editor where you may use variables, have {V} button which helps you to select necessary variable and insert it into current field.
Post Reply