How to filter out files for file transfer based on part of their name (containing date)

Discussion created by Peter_Fekete_8604 on May 31, 2017
Latest reply on May 31, 2017 by Wolfgang_Brueckler_1288

How to filter out files for file transfer based on part of their name (containing date)

 Question and restrains:

The end user requirement is to setup a file transfer object to transfer the latest file in the path on a source to destination.
- The file names have the same prefix - and ends with the date it was created.
- so every day we have new files getting added to the source with the same prefix and ending with the date it was created.
- I want to pick only the file which was created on the same day and transfer it.


 If you really know the date of the file creation (or the transfer is on the same date) and you are sure the filename will contain the date.
You can use the process tab of the transaction to call the date function, which will give you current date.
Save it in a variable and format it.


Then use the variable &DATE# and concatenate it into file name with the directory path, prefix and suffix and then paste it into the Source file field as attribute.

explained also in this community post by @
Wolfgang Brueckler


:SET &FILENAME# = "Directorypath_prefix_YYYYMMDD.suffix"

This way you do not need to hard-code the source file location and file name into the FileTransfer attribute filed and can change it ad-hoc with your script


You can as well incorporate wildcards * in the mix, for example in our example path

:SET &FILENAME# = "Directorypath_prefix_YYYYMMDD*"