Copy Files and Rename with A Date
In the CorVu scheduler, you can copy a file and give it a unique file name. A common use of this would be to put the date at the end of a file name. Running the scheduler every week or month would then give you a set of dated ‘snapshots’
In the scheduler, at the point after the file is produced, ADD/COPY FILE. A quite complex screen comes up. Don’t panic!!
For the source, keep the option of ‘Literal’ and just browse to the file you want to copy. This should be the one you have previously scheduled. So far so good.
For the Destination, drop down from ‘Literal’ to ‘Formula’. Now in the box underneath, type in the path name of the location you want to copy the file to, and the filename. It’s like a normal file location, except that you need it in single quotes and where you would put 1 slash before, you now need two.
So, for C:\Corvu\Data, you would need ‘C:\\Corvu\\Data\\filename’
Now for the science bit…
Add the date formula in, and force it into the date format you require, in this case MMDDYY. As the date bit is the formula and not the path, it has no single quotes and it needs a + at the start and end.
‘C:\\CorVu\\Data\\filename’+ format(today(),’MMDDYY’)+
Then the file extension, for example .SQY, .QRP, .XLS .HTM , in single quotes, not forgetting the dot.
‘C:\\CorVu\\Data\\filename’+ format(today(),’MMDDYY’)+’.sqy’
There is much more that can be done at this level, but try this for now.
L
Anonymous said,
I would recommend using the format YYYYMMDD for the date string. It’s the ISO standard. It makes sorting work better. It’s less ambiguous (what is meant by 070809? There are 3 possible interpretations in common civil use worldwide). Also when entering date constants CorVu will check for an 8 digit string first and if it finds one will assume ISO, which can be important if deploying an app across regions where regional settings in the Windows registry might differ, giving another form of date constant a different meaning.
lm said,
Many thanks for the comment, Mr Anon Bogus from Australia. I was thinking from a UK centric basis and I’d actually not recommend any ‘fixed’ format as it will depend company to company as mosty are not international. Anyway, an interesting point on how CorVu works internally and one can only embrace the software accounting for ISO’s. I do however think you have been slightly harsh in saying ‘what is meant by 070809?’ when CorVu’s own help example suggests the more meagre MMDD!
Brychan said,
Hi,
I was wondering is there anyway for corvu(5.1) then to email these reports, I far as I can see on the scheduler it requires a fixed filename.
Thanks
sw said,
Hi Brychan,
Sorry for the late response but seem like your question just got missed.
Well you can use the simliar copy function to copy the file in a workingdir with a general name without date part and have a email task subesquently to pick this up.
Add A Comment