Strip date from filename filter and move files older than the x days
Q: I want to make a file filter-> regex filter able to move files older than the current date -n to another folder.
The files i question are named like this: hjernetrim-quiz-helside_2025-
I can’t figure out how to use the regex Filter. I have no luck with this: hjernetrim-quiz-helside_TCD:[ IncDay-5]yyyy-mm-dd:
Can you help me finding the correct filter syntax?
A: In this case we are going to strip the date part from the filename and convert it to a Date. Afterwards we’ll compare this with the current date and when older than 5 days we’ll allow the file to be moved. We are not going to use a file filter for this but instead use a little script.
- First setup your Source, we used a Windows folder as Source:

- Open our Pascal Script option:

- Enable and add the following ‘On Destination’ script: link
- You can adjust the ctOlderThanDays Const if needed. At the moment it is set to 5

- As Destination we used a Windows Folder:
- RunTime Log Result:
If you need any help with this “strip date from filename filter”, please let us know.
Best Regards,
Limagito Team
#managedfiletransfer #filetransfer #filemanagement