Regex help copy file based on content - VisualCron - Forum

Community forum

I am trying to create a rule to move files based on content I have been trying to use Regex but with out much luck.

All the files that I want to move are XML based but I want to move files that have a C1 Element that look like the following in to one folder and files that don't have this move to another.

Here is what the C1 Elements would look like


AS you might be able to spot the C1 values is made up of 2 GUID's with a pipe command in the middle. Each XML file that I want to move will have 2 different sets of GUIDS

Any help creating a rule Regex rule based on content would help me out heaps.
This is what I came up with so far..


Just not sure if visual cron would be up to reading and looking at about 20k worth of files.

It is probably not recommended scanning file content of so many files at a time. If it is a one time run - then use a script instead.

If you want to do this on a regular basic then it is OK in combination with a File Trigger. Then you only scan new files - when then are created.

As for the Regex we are not experts on that but perhaps somebody else in the forum.
Please like  VisualCron on facebook!
Hi Henrik,
Thanks for your reply yes I guess it would not be to work on a directory of 20k files but more to look at a directory as files where being created and then move them on a given day it could have to manage 20k worth of files.

I am still pretty new to VC (I used it a few years back but much has changed) I am thinking to create a new job and then creating 2 Copy Jobs one to copy files that match the above Regex and One that does not.

Copy files with a GUID to c:\GUIDFILES\
Copy file with out a GUID to c:\NONGUIDFILES\

I have run in to problems with VC on a trigger if 2 new files are created then VC will only pickup the first file ? (is this maybe a user error setting up a bad trigger ?)

Can I create a Trigger based on a Regex for a file mask eg

only Trigger the Copy task if the file names are either filename1.xml|filename2.xml
You need to check option "Put Job in queue". Then one Trigger will be processed at a time.

No, there is not possible to use regex on file filter but you add a normal file filter - then use regex on the Copy file Task.
Please like  VisualCron on facebook!
Users browsing this topic
Scroll to Top