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

  •  TCG
  • Free support Topic Starter
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

Not sure about which variable to use in the archive path

Thank you
Forum information
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 ?

You can use the following Variable combination for the file name of the zip: Report {DATEFORMAT(MMM)} {DATEFORMAT(yyyy)}.zip
Please like  VisualCron on facebook!
Scroll to Top