How to move to different destination based on day of week
Q: I was wondering if you have an easy way to determine the day of week based on the filename and move to different locations:
- In our example we used a Windows folder as Source:
- Next, please open our “Pascal Script” option:
- Enable and add the following ‘On Destinations’ Pascal Script: link
- This script will strip the filename into parts using “_” as delimiter. The second part (= Index [1] of our list), which is the datepart, will be converted to a TDateTime var. Next we’ll use the DayOfTheWeek function to determine the day mentioned in the filename. The result of the function will be used to set the correct destination folder to our psVSA variable (= %VSA as parameter). We added ctFolder1 and ctFolder2 as Const.
- In our example files from Monday to Friday will go to folder 1 and files from Saturday and Sunday will go to folder 2. This can be easily adjusted.
- As Destination we are using [WIN] and the Directory is set to: %VSA\
- This %VSA is set by the previous “On Destinations” Pascal Script
- RunTime Log Result:
This is is just an example of what is possible. If you need any help with this ‘destination based on day of week’, please let us know.
Best Regards,
Limagito Team
#managedfiletransfer #filetransfer #filemanagement