Joined: 27 Oct 2008
Location: Bethlehem, PA
|Posted: Wed Jun 23, 2010 12:01 pm Post subject: How do I use a variable to select the files for a copy task?
|What is the best way to copy/move files based on dynamic substring?
For example I have files following the naming convention:
Note the first 6 characters/digits change on a daily basis.
I would like to create a task to move all files with the same first 6-20 characters into a fixed directory (which is used for zipping- I know how to do that). My understanding is that I would need to use a variable to capture the first 6 characters (from a directory loop::filename) then use that variable to select the files of the copy task.
How do I load a variable to select the files for a copy task, then use it to move the files?
I created a script which reads the filename from a File monitor task.
Perform the necessary string manipulation in my script.
Set the Filename parameter (#3) for a copy task to my manipulated string.
Call the copy task from the script.
Never underestimate a good night's sleep...