Here is one way to achieve this. You can use the Expression Task in conjunction with the Foreach Loop Container to match the numerical values ββof file names. Here is an example that illustrates how to do this. The example uses SSIS 2012 .
This may not be very effective, but it is one way to do this.
Suppose there is a folder with a bunch of files named in the format YYYYMMDD. The folder contains files for the first day of each month since 1921, such as 19210101, 19210201, 19210301 .... all in the current month 20121101. This adds up to 1,103 files.
Let's say the requirement is only to scroll through files created since June 1948. This would mean that the SSIS package should only 19480601 files greater than 19480601 .

In the SSIS package, create the following three parameters. Itβs better to configure the parameters for them, because these values ββare configured in the environment.
ExtensionToMatch - This String data type parameter will contain the extension that the package must execute. This will add the value to the FileSpec variable, which will be used in the Foreach Container container.
FolderToEnumerate - This String data type parameter will save the path to the folder containing the files to be scrolled.
MinIndexId - this parameter of the Int32 data type will contain the minimum numerical value above which the files must match the pattern.

Create the following four parameters to help us iterate over the files.
ActiveFilePath - This String data type variable will contain the file name as the Foreach Loop container goes through each file in the folder. This variable is used in the expression of another variable. To avoid an error, set it to a non-empty value, for example: 1.
FileCount is an Int32 dummy variable that will be used for this example to illustrate the number of files the loop loop will go through.
FileSpec - This String data type variable will contain the file template. Set the expression of this variable below the specified value. This expression will use the extension specified in the parameters. If there are no extensions, it will *.* Move through all files.
"*" + (@ [$ Package :: ExtensionToMatch] == "?". * ": @ [$ Package :: ExtensionToMatch])
ProcessThisFile - This Boolean data type variable will determine whether a particular file meets the criteria or not.

Configure the package as shown below. The Foreach loop container will go through all the files matching the pattern specified in the FileSpec variable. The expression specified in the Expression task will be evaluated at run time and will populate the ProcessThisFile variable. Then the variable will be used to limit the priority to determine whether to process the file or not.
The script task in the Foreach loop container will FileCount variable FileCount by 1 for each file that successfully matches the expression.
A script task outside the Foreach loop will simply display how many files have been looped by the Foreach loop container.

Configure the Foreach loop container to cycle through the folder using the parameter and files using the variable.

Store the file name in the ActiveFilePath variable as the loop goes through each file.

In the Expression task, set the expression to the following value. The expression converts the file name without the extension to a number and then checks if it exceeds the value specified in the MinIndexId parameter
@ [User :: ProcessThisFile] = (DT_BOOL) ((DT_I4) (REPLACE (@ [User :: ActiveFilePath], @ [User :: FileSpec], ""))> @ [$ Package :: MinIndexId] 1: 0 )

Right-click the Precedence constraint and configure it to use the ProcessThisFile variable in the expression. This tells the package to process the file only if it meets the condition specified in the expression task.
@ [User :: ProcessThisFile]

In the first script task, I have a User::FileCount variable set in ReadWriteVariables and the following C # code in the script task. This increases the counter for a file that successfully matches the condition.
public void Main() { Dts.Variables["User::FileCount"].Value = Convert.ToInt32(Dts.Variables["User::FileCount"].Value) + 1; Dts.TaskResult = (int)ScriptResults.Success; }
In the second script task, I have a User::FileCount variable set in ReadOnlyVariables and the following C # code in the script task. It simply displays the total number of processed files.
public void Main() { MessageBox.Show(String.Format("Total files looped through: {0}", Dts.Variables["User::FileCount"].Value)); Dts.TaskResult = (int)ScriptResults.Success; }
When a package runs with MinIndexId set to 1948061 (excluding this), it 1948061 773 .

When a package runs with MinIndexId set to 20111201 (excluding this), it 20111201 11 .
Hope this helps.
