Get downloaded filename and store in a variable - VisualCron - Forum

Community forum

felix
  •  felix
  • No customer Topic Starter
2014-08-11T22:49:24Z
So I know how to set a variable using the set variable task, but I'm not sure how to get the filename of a downloaded file from the download ftp task, if that task uses a mask (like *.csv) to download the file/files.

I want to use the variable as a parameter for a script (I already know how to do this)
ErikC
2014-08-12T06:07:30Z
Hi Felix,

If you look at the task specific variables you can see a result section in the ftp download. There is one named:

{TASK(#idoftask#,Result.DownloadedFilesNames)}

This contains the filesnames downloaded.

Regards,
Erik
Uses Visualcron since 2006.
felix
  •  felix
  • No customer Topic Starter
2014-08-13T15:05:24Z
Thanks, and how would I figure out what the type of a variable is and how it is formatted? For instance, {TASK(#idoftask#,Result.DownloadedFilesNames)} is filenames separated by some kind of line break character (figured this out by having a task output the value to a text file) but if there's only one file downloaded it is just that one file name. Is there an easier way to just see this? Also then if there are multiple files (which I might deal with later) is there a way to iterate through those file names in a script? or have visualcron output the file names one at a time for the script to process? (since the script I'm using only takes one file name) (the script im using is an exe file and im not sure what language it was actually written in or if it can be edited)
Support
2014-08-13T20:47:25Z
You can either use PrevTask as Id if it is the previous Task you want to reference to. Or you can find the exact Id by opening the Variables window and go to Jobs tree item and scroll down to the actual Job and Task and expand it further.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top