Find \ Replace within a .csv

  • I would like to execute a simple find and replace of a single character within the contents of a .csv file but I'm not sure how to execute this task via SSIS. Any assistance assistance would be great appreciated.

    Thank you!

  • Hello,

    You may use Derived Column transformation in Data Flow task and REPLACE function should be able to replace the character in the required column(s).

    REPLACE( «character_expression», «search_expression», «replace_expression» )

    Cheers!

    Maninder Kumar

  • Thank you for the information. Will this work if I want to change the column header itself? I'm following the steps but does derived column only update the contents within the column?

  • More detail...

    In SSRS when a .csv is generated the columns are created with an "underscore" when there is a "space" in the header name. The column header must restore the "space" in the column name.

  • Have you tried renaming the column in the Flat File Connection Manager Editor? Select Advanced and then the column and then you can change the name.

  • I understand updating the connection manager but do I need to execute a data flow task?

  • If you want overwrite the existing file with the changes to the column name then yes you do.

  • This was a perfect solution!!

    1. Generated two reports

    2. Created a source data flat file (temp report #1) and destination data flat file (final report #2)

    3. Updated both data sources via the advanced config to the column names replacing the "underscore" with a "space"

    4. The destination report is updated with the correct column description

    Thank you!!

Viewing 8 posts - 1 through 7 (of 7 total)

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