September 17, 2019 at 11:36 pm
I am trying to loop reach file in the foreachloop container based on date timestamp
file names will be
bookride_190827184345.txt
bookride_190906173907.txt
bookride_190906174008.txt
I have an SSIS package where i need to process these files based on date timestamp first loop has to process bookride_190827184345.txt, next bookride_190906173907.txt last bookride_190906174008.txt
using script task how to achieve this?
September 17, 2019 at 11:50 pm
Wouldn't you declare a variable to hold the filename and then use .NET functions to parse out the chunks you want that make a date? Then compare it to some value to determine what to do with the file?
September 18, 2019 at 1:18 am
The files all have the same prefix before the time stamp. That means they'll sort naturally and you don't need to split anything out of the file name to process them in order.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 18, 2019 at 7:51 am
Unless i recall incorrectly, using a For Each Loop Container on a file directory will process the files in alphabetical order; so there's no need for a script task here.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply