Trigger file extracting just the file name and not the extension - VisualCron - Forum

Community forum

beechc
2011-02-23T13:30:28Z
I just downloaded the demo yesterday, and am obviously completely unaware of the feature set. Looking through previous posts I have managed to put a few pieces together, but am looking for some advise and at the same time some help.

Here is what I want to do.

I am being presented with a .txt file on a network share that acts as a trigger (ABC123.txt for this exercise). Elsewhere in a repository there is a collection of PDF files.

Based on the arrival of ABC123.txt 3 things need to happen.
1. The trigger file needs to be copied to a new location.
2. The matching PDF needs to be copied from it's repository to the same "new" destination. (ABC123.pdf)
3. Cleanup the trigger folder. (This is just a delete right?)

From a previous post on this forum I was able to retrieve the filename from the trigger event using: {TRIGGER(Active,LastTrigger,File.Result.Name)}

Question 1
I there an explicit command that will retrieve just the base name without the extension?

Question 2
If there is not an answer to Q1 is it possible to use a regular expression to extract the file name? can a REGEX be used on a statement as above (^.*)$ with any success?

Question 3
Am I going down the wrong path and should I use a .bat file to do the same function and just call it based on the arrival of the file?

Support
2011-02-23T19:59:35Z
Q1:

You could use Variables for this. And use a Variable inside a Variable.

{PATH(GetFileNameWithoutExtension|{TRIGGER(Active,LastTrigger,File.Result.Name)})}

Q3: It is more effient to do it in VisualCron. Please remember to check "Put Job in queue" in main settings of the Job.


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top