DTS Source File Issues

  • How would I search for the name of a text file to use as my source file only by searching on part of the file name? For example my file name is 20020401_abc.txt

    And I want to search for just abc.txt

    I then will be taking the results of the search and creating a Dynamic Properties Task that will then change the Source Value prior to starting the actual transformation.

    The directory that I am searching contains approximately 8 files. Each file has there own unique naming convention will should make searching for the file easy. For example here are the files:

    20020201_abc.txt UNIQUE VALUE/SEARCH VALUE = abc.txt

    G22_201256478.dat UNIQUE VALUE/SEARCH VALUE = G22.txt

    6754B_20020402.txt UNIQUE VALUE/SEARCH VALUE = 6754B.txt

    Util23_888800.txt UNIQUE VALUE/SEARCH VALUE = Util23.txt

    Each of these files is unique in there own way and each file is used in its own DTS package. The problem is that I haven’t found a way to search for there uniqueness. I tried FSO but I can’t use wild cards to search.

    Any help here would definitely help.

    Thanks

  • How about using FSO, loop thru the files in the folder and use a string function to find the file you're interested in?

    eg: If RIGHT(oFile.Name, 7)) = "abc.txt" then

    ... do something with the file ....

Viewing 2 posts - 1 through 1 (of 1 total)

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