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


Natural Power
2013-10-24T15:40:24Z
Is it possible to use wildcards in a file condition?

For example, I have a task which runs a Python script, but I only want it to run if there is a csv file present in a specific directory. I have created a file condition with File Path: \\server\folder\*.csv

I can't seem to get this task to run even though there are .csv files in the specified directory. Is it the case that the file condition does not accept wildcards and instead has to be a specific file?
Sponsor
Forum information
ErikC
2013-10-25T05:50:29Z
Hi windmanager,

I just tested this with version 7.0.5, but that seems to work fine.
I tested it with a local path though.

You can turn on the 'Extended debug logging' and see waht's in there.

Which version are you using?


Regards,
Erik
Uses Visualcron since 2006.
Natural Power
2013-10-25T09:10:57Z
Hi Erik

The current version I am using is 7.0.4. I have managed to work out a way to store the file on the VC server so they are now held locally. I changed the File Path to the following: 'C:\WCR Data\{LOOP(CurrentValueX)}\LiveFeedSiteData\*.csv'.

After running the job, the error log shows the following:

"Condition Set (Task) returned: MatchError-> ActionNext"
"FileExist Condition check failed: The given path's format is not supported"

I then amended the File Path by removing the *.csv wildcard so that it read: 'C:\WCR Data\{LOOP(CurrentValueX)}\LiveFeedSiteData"

In the log it now showed:

"Condition Set (Task) returned: MatchError-> ActionNext"
"FileCondition (FileExist->MatchFalse) returned : NoMatch"

It appears that either with or without the wildcard it could not pick up a match, even though there were files in the folder.

Apologies, I wanted to add screenshots of the log output to make it easier to see, but I can not see how to attach an image file to my post.
Natural Power
2013-10-25T09:58:42Z
So, it appears that the issue is with the combined use of the {LOOP(CurrentValueX)} and the *.csv wildcard in the File Path. With both these present (File Path: "C:\WCR Data\{LOOP(CurrentValueX)}\LiveFeedSiteData\*.csv"), the log shows "FileExist Condition check failed: The given path's format is not supported".

If I remove the wilcard, the log shows "FileCondition (FileExist->MatchFalse) returned : NoMatch".

If I remove both and enter a hard coded path that I know exists, i.e. "C:\WCR Data\BIL\LiveFeedSiteData\*.csv", the job executes successfully.

However, the problem is that I need the job to loop round a number of directories and run the Python script for files in all of these folders individually. I know that the {LOOP(CurrentValueX)} is valid, as this is used successfully in the preceding tasks within the same job.

Is anybody able to confirm that there is indeed an issue with making combined use of the LOOP and the wildcard within the File Path?

Thanks
Scroll to Top