How to recognize dynamic file

  • I have to identify a dynamic text file in my source connection in SSIS.

    eg. FileName is ABCYYYYMMDDtttt.txt.

    Here ABC is file, YYYY is Year, MM is month, DD is date and tttt is TIME.

    I am able to get to ABCYYYYMMDD using expressions.

    how to identify tttt (TIME factor). It can be random every day.

    eg. ABC20081203123245.txt (file received on 12/03/08)

    eg. ABC20081204453467.txt. (file received on 12/04/08).

    As we see in above 2 file names, date part can be recognized through expressions but time part is dynamic.

    How to get around to identify these type of files in source connection?

  • Is it permissable within your environment to use an upstream process to capture the dynamic file and copy or rename it to a known static name? That's how I've dealt with this type of issue when I've run into it.

  • nope

  • It would be awfully cludgy, but if you have file system access from your executing account, you could try putting some type of file watch process on your inbound data directory to capture the name of an inbound file, then build an XML config file on the fly that contains it.

  • mm... I'm confused... you say the time format is "tttt", but you have six characters for the time in both examples and one of the sets of 6 looks like... 453467.

    That's not a "time"... but it does look like it could be the number of milliseconds since midnight.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply