Update the column in a flat file using Script task

  • Hi friends,

    I want to update the Flat file column b4 using it into the data flow task.

    For ex : I have a flat file which has months column having values jan,feb, mar so on, i want to update the flat file (.txt) b4 using it as a source in the data flow task.Months should be represented as numbers like for jan replaced by 1, feb replaced by 2 ..... in the flat file.

    numerical values(Reference values) can be taken from table.

    can anyone help with code used in the Script task

    please,

    Thanks in advance

    Arvind

  • I think there is a better way..

    As a matter of fact I can think of two..

    First way (best):

    1. Build a table that contains the text values and the id of the month

    MonthId, MonthAbbr

    1 Jan

    2 Feb

    etc..

    2. In the Dataflow use the lookup dataflow transformation, use the Month Abbreviation to output the MonthId.

    Second way (ok):

    1. Use the derived column dataflow transformation and build an if/then/else kind of logic in the expression, not pretty..

    CEWII

  • Thanks CIWII for the reply. This is easier way to do it.:-):-)

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

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