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


osirisja
2011-08-15T20:07:01Z
Hi all

I'm a new user of VC and so far i'm very impressed with the range of functionality it provides. I just have one requirement that I'm hoping can be fulfilled with VC.

I receive a data file via FTP and based on the filename mask, I will run a particular external application to format a document - passing a number of parameters at run time. This is all mostly do-able and I can understand how to configure the running of the job. However, what I need to be able to do prior to executing the external app, is load a text 'template' .PRF file with a selection of value/name pairs, some of which will have VC replacement variables imbedded (e.g. INPUT = {mypath!myfilename}) which is then replaced by the full path and filename of the incoming data file (e.g. INPUT = X:\DATAIN\ABC123.TXT) and re-written out into a {VARNAME}.PRF text file in a Process directory. I will need to do this with a number of variables in the same PRF template so I might even consider also loading matching values from an excel spreadsheet (or perhaps even a separate config file).

I can then succesfully run the external application with the accompanying profile - e.g. 'RUN' C:\APPS\FORMATDOC.EXE /PROFILE={VARNAME}.PRF

So my question is simply - is this possible? Are there any examples I can follow?

Many thanks in advance

Andy
Sponsor
Forum information
Support
2011-08-15T21:42:30Z
First you need a File Trigger to capture the new file and file name. You have a tutorial here about file triggers:

http://www.visualcron.com/Tutorials.aspx 

In the tutorial you will see how you can use Variables from that newly picked up file elsewhere.

It is important to know that Variables can be inserted anywhere in any setting.

There is no problem using the File read Task to read your PRF file just before you try to Execute your app in the Execute Task.

The only problem might be to get the specific text from the file. The full file will be stored in the Standard out value of the previous Task - in this Variable:

{TASK(PrevTask,StdOut)}

I assume the best way to get a specific Value is using the RegEx function on that string:

{REGEX(Match|1111,222,33|\A[0-9]*)}

Hope this get you started and let us know when and where you get stuck!

However, I am no expert how to get a specific key/value but you can probably get help on the Internet for that.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2011-08-16T19:10:01Z
Hi Henrik

Thanks for your suggestions - I have been able to load in a text file (just for testing) and I can see the contents in STDOUT, however what I can't seem to do is 'loop' through the contents of STDOUT and assign the records to a list/array.

I have looked through visualcron but can't seem to find any reference to these kinds of features, so I assume they are not possible? If this is the case, do you have any plans to introduce these any time soon?

Thanks again

Andy
Support
2011-08-17T12:08:18Z
Yes, we have plans to introduce different forms of looping soon. What you can do, in the meantime, is to use Regex on the actual Output Variable and retrieve them one by one. I don't know how many variables you have but that is one way to solve it.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top