Help Needed Inporting a file

  • I have a mixed text file ( sample below ) , and i need to import it into a Table. The first 10 lines of the file are to be ignored.

    In the table there are 7 Fields. as below

    A Field 1

    B Field 2

    C Field 3

    D Field 4

    E Field 5

    F Field 6

    G Field 7

    What i need to do is import from Line 10 ( easy to set in Bulk Import task ) , but i also need to add a value from a variable as field A, which is confusing the hell outta me

    File Sample against the table fields

    333333,44444444,JOHN SMITH ,000600002 ,00000095726,99

    B C D E F G

    Sample File

    111111

    111111

    111

    20/11/2007

    23/11/2007

    Somewhere@overtherainbow.com

    111

    11111111

    111

    222222 IMPORT FILES AuthCode: 1111

    333333,44444444,JOHN SMITH ,000600002 ,00000095726,99

    333333,44444444,JOHN SMITH ,000600002 ,00000095726,99

    333333,44444444,JOHN SMITH ,000600002 ,00000095726,99

    333333,44444444,JOHN SMITH ,000600002 ,00000095726,99

    333333,44444444,JOHN SMITH ,000600002 ,00000095726,99

    in the table the records need to read

    MYRef 333333 44444444 JOHN SMITH 000600002 00000095726 99

    A B C D E F G

    Can anyone explaing how to do this or suggest another method. Some of the files recieved have over 11 thousand records

    Thanks in advance

  • Peter,

    This can be handled with a data transformation that includes a dervied column task.

    Create a flat file connection manager and set it to skip the first ten rows and set up the columns appropriately.

    Create a new Data Transformation Task

    Crate a new flat file source and point it to the connection above.

    Drag a derived column and connect the flat file source. Create a new column [A] that is filled by the variable.

    Drag an OLEDB destination, connect the derived column output, set up the connection and load.

    Regards,

    Norman

    DTS Package Search

    http://www.dtspackagesearch.com/

  • brilliant, thank you 😀

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

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