Last month, I showed you how to create a FileSet to SFTP a list of files based on certain selection criteria. This month, I’m going to show you how to take advantage of that FileSet by creating a FileList. You can review how we created the FileSet by clicking on the link: Using File Lists via SFTP
FileLists can be created several different ways:
1. As the result of the CreateFileList Task
2. As an Output Variable of a local file task (copy, move, rename, encrypt, etc)
3. As an Output Variable of a remote file transfer (ftp, sftp, ftps, etc)
4. As a Parameter passed into a Project from a Monitor
Once you have the FileList variable created, manipulation of the file(s) associated to that FileList becomes as easy as typing a Variable into a Prompt … no matter how many files there are!
Our previous example created a FileSet by executing the FTP|Put Task. (See Figure 1)
In today’s example, we will convert our FileSet into a FileList variable, and then use that variable to archive our files using the Copy task.
To convert this FileSet into a FileList variable, click on the “Send Files to Target” task and select the “Output Variables” tab. Type “locFiles” into the “Processed Source Files Variable”. This will give you a FileList variable that will contain just the files (on the source server) that match the selection criteria identified under the FileSet element. (See Figure 2)
Now, for example, it becomes easy to Archive the files you transferred with one command!In the project outline, add a new Copy task. Name the task “Archive Files,” and then place the FileList variable in the “Source Files Variable” field. (See Figure 3)
Execute the project and review the joblog. You will see that the files are identified and moved (archived) as a group of files. (See Figure 4)
Feel free to contact Linoma Software with any questions or to inquire about our On-Site Professional Services or Training Programs.