File Properties Task Question (Wish List)

Mar 11, 2011 at 12:43 PM
Edited Mar 11, 2011 at 12:50 PM

I installed the File Properties Task and really like a lot of the features.  It appears you have to know the complete path / filename to check for the existance of that file. Naming conventions of files usually contain date and time stamps as part of the filename.  ie Myfile20100311.124530.  The time stamp being granular in the filename is the issue because through an expression you could set the current date (YYYYMMDD) and have a job check the folder daily. 

Based on what I have seen, unless I am missing something, it appears to be back to using a Script Task to do this (which I was trying to avoid).

If this feature is not supported, how do I uninstall the control/ task?  In recieving files, a majority of my packages I write, I will not know the name of the file in advance of checking for it.  The folder / path will be static and set in a variable.

Thanks!

Barry

 

Coordinator
May 3, 2011 at 9:57 PM

Easy (sorry for the late reply) - there are a couple ways to get this done.

One way is to create an SSIS variable - call it "FileName".  Edit its properties (F4), and set the EvaluateAsExpression property to true.  Edit the Expression property and set it to something like this: "Myfile" + (DT_WSTR, 4)YEAR(GETDATE()) + RIGHT("0" + (DT_WSTR, 2)MONTH(GETDATE()), 2) + RIGHT("0" + (DT_WSTR, 2)DAY(GETDATE()), 2) + "." + RIGHT("0" + (DT_WSTR, 2)DATEPART("HOUR", GETDATE()), 2) + RIGHT("0" + (DT_WSTR, 2)DATEPART("MINUTE", GETDATE()), 2) + RIGHT("0" + (DT_WSTR, 2)DATEPART("SECOND", GETDATE()), 2).  Now use that variable as the "source" for the File Properties Task.