I have flat file. I am loading data from flat file to source table using ssis.And one of the column has following values:
I think you have almost got the expression correct except for the additional slash in the replacement string. Here are the expressions that might work for you.
Expression #1: Removes all double quotes within a given string.
REPLACE(COLA, "\"", "")
Expression #2: Replaces all double occurrences of double quotes with single occurrence of double quotes.
REPLACE(COLA, "\"\"", "\"")
Here is an example that demonstrates expression #1:
Derived Column transformation
inside the Data Flow task
that will replace all double quotes within the first column named as Header.Here is an example that demonstrates expression #2:
Derived Column transformation
inside the Data Flow task
that will replace all double occurrences of double quotes with single occurrence of double quotes within the first column named as Header.Hope that helps.
Screenshot #1:
Screenshot #2:
Screenshot #3:
Screenshot #4:
Screenshot #5:
This may not work if your other columns don't have this same issue, but if this is the only text column you are importing or they are all like this, you could change your text identifier to be two double quotes instead of one. Then SSIS would bring it out of the flat file correctly and you wouldn't have to deal with trying to clean it up later.
Please find below samples
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Client_1,"\"",""),"*",""),",",""),"[",""),"]",""),"'",""),"!",""),"/",""),"<>","")