DTS Text Excluding Text

  • I have a source text file that in every instance the last line is an overview or results totals from all previous lines, a trailer if you will. This trailer (last line) information always begins with the name TRAILER. Her is what needs to occur:

    1) Not include the last line in the transformation between my first - text source to table transformation.

    2) Grab the last line and populate its information in a separate table.

    3) Not include the word TRAILER as my first column of data in my second data transformation process.

    I have already created the table for all of the lines before the trailer and I have also created the trailer table.

    Any ideas on how to accomplish this task would be much appreciative?

    Thanks

    Text File

    Text File1 (not including last line) ---- > Table one

    Text File 1 (including only last line of text and excluding the word trailer) ----- > Table two

  • This is a DTS Designer (GUI) solution.

    1. Use the datapump task to pump data from table one to table two.

    3. Use an ActiveX script to add an IF statement to handle the "TRAILER" case.

    5. Define a lookup that does an insert into the "Trailer" table.

    6. When the IF condition is met call the lookup to do the insert of the Trailer row.

    7. Return a SKIPInsert Constant to Main.

    8. Done.

  • Is your file delimited or fixed width?

  • trobinson, Cool!

  • quote:


    Is your file delimited or fixed width?

    Delimited


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

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