none
Retrieving values in between '=' sign

    Question

  • Hi All,



    I have a EXCEL file stored in the format of .csv file.

    I am using a Flat File connection manager to move the data from Source(.csv) to SQL destination.

    I have a column in .csv file which holds the value as =123456789=

    I need to retrive the data IN BETWEEN the ' = ' sign. i.e. 123456789 and move it to the SQL SERVER destionation.

    Any suggestions would be of great help.

    Thanks in advance.


    Saturday, September 14, 2013 1:53 PM

Answers

  • Hi ,

    Add Derived Column Transformation in between source and destination .

    Inside  Derived Column Transformation , write expression for that column using string functions .

    --if you are on ssis 2012
    TOKEN("=123456789=", "=", TOKENCOUNT("=123456789=", "="))
    --or
    REPLACE("=123456789=", "=", "") 
    --or
    SUBSTRING("=123456789=", FINDSTRING( "=123456789=", "=", 1)+1 ,
    FINDSTRING( "=123456789=", "=", 2)- FINDSTRING( "=123456789=", "=", 1)-1)  


    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.


    Saturday, September 14, 2013 2:34 PM
    Moderator

All replies

  • Hi ,

    Add Derived Column Transformation in between source and destination .

    Inside  Derived Column Transformation , write expression for that column using string functions .

    --if you are on ssis 2012
    TOKEN("=123456789=", "=", TOKENCOUNT("=123456789=", "="))
    --or
    REPLACE("=123456789=", "=", "") 
    --or
    SUBSTRING("=123456789=", FINDSTRING( "=123456789=", "=", 1)+1 ,
    FINDSTRING( "=123456789=", "=", 2)- FINDSTRING( "=123456789=", "=", 1)-1)  


    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.


    Saturday, September 14, 2013 2:34 PM
    Moderator
  • Hi Sathya,

    It works fine. Thanks for the help... :-)

    Monday, September 16, 2013 5:29 AM