Trimming text files, connections

  • I have created DTS packages that use text connections. The problem is that I want to be able to trim off parts of the file name and I want to do it in the DTS package. For instance

    Trim name of file à connect to text file à Transform data à DB Connection

    Name of File:

    200201_extamb1200.dat

    I need to trim off <200201_> and then reference in my DTS just extamb1200.dat for my text connection. What would be a good way to do this in the package itself? I want to be able reference this file the same way every time without manually changing the name of it.

    Thanks

  • Use an ActiveX script like this:

    Dim FileName

    FileName = "extamb1200.dat"

    dim fso, fldr, f

    set fso = CreateObject(Scripting.FileSystemObject")

    set fldr = FSO.GetFolder("MyFolderPath")

    set f = fldr.Files(0)

    f.Name = FileName

    set f = nothing

    set fldr = nothing

    set fso = nothing

    set FileName = nothing

  • Do I know need to remove the text connection and create a Workflow - on completion from the Active X scrip directly to the 2nd connection which happened to be the DB I’m inserting the data into?

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

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