Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


TCG
  •  TCG
  • Free support Topic Starter
2016-05-13T09:31:04Z
Hello fellow forum members

I have difficulty with naming a file when creating a ZIP archive

The source path is \\server1\reports\Report May 2016.xls
We would like to ZIP the file and store it in \\server1\zip\Report May 2016.zip

Not sure about which variable to use in the archive path

Thank you
Sponsor
Forum information
bbusse
2016-05-13T18:40:25Z
I'm not sure there will be a variable for this. Since Archive tasks are usually set to archive via wildcards or filemasks in a given folder, it would be difficult to account for that. You might be archiving one file, but it could be many files... and what name would it use then?

I'm trying to think way outside the box here and come up with a way to do what you're wanting, but i think it'd be ugly.

I.e. lets say you want to do what you said, in the most basic of terms. Every XLS file in a particular folder needs to be zipped into its own zip file.

I'd have 2 tasks. First, a list Files task. then a 2nd task, that is the archive task. There would be a loop that uses a 'for each x in' the output of the list files task, but only on the archive task. You would place the variable for the current value in the loop (file name), which is {LOOP(CurrentValueX)}, as your file mask so it's the only file being archived. You could then use the same variable, {LOOP(CurrentValueX)}, along with some other variable functions to manipulate it as your destination file name.

Your resulting archive file name would be: {STRING(Replace,{LOOP(CurrentValueX)},.xls,.zip)}
The above takes your current file name and replaces .xls with .zip

Think that'd work ?

Brian
Support
2016-05-15T19:56:39Z
You can use the following Variable combination for the file name of the zip: Report {DATEFORMAT(MMM)} {DATEFORMAT(yyyy)}.zip
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top