how to replace quotation marks in a derived column?
I have a flat file containing data in which some fields contain quotes, but not all fields. I am trying to use derived columns to remove the quotes from the evil fields and I need help with an appropriate expression. In other words, the flat file has: PRODUCT, LEVEL,CD "abc","123",NE "def", "456",SE And I need the table to look more like this: PRODUCT LEVEL CD abc 123 NE def 456 SE Just FYI, this does not work: (DT_STR,50,1252)REPLACE([PRODUCT]," '' "," ") and neither does this (DT_STR,50,1252)REPLACE([PRODUCT],"''"," ") The data imports, but the quotes are carried through to the table. Sorry if this should be obvious, but I'm stuck. Please help??!? Also if there's a better way to handle this than a derived column, please offer any and all ideas! Thanks!
February 3rd, 2010 6:04pm

Escape them.REPLACE([PRODUCT],"\""," ")Phil Brammer | http://www.ssistalk.com | Twitter: http://twitter.com/PhilBrammer
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 6:05pm

It works! It works!! Phil, do you know EVERYthing? :) THANK YOU! Erin
February 3rd, 2010 6:08pm

It works! It works!! Phil, do you know EVERYthing? :) THANK YOU!Erin In a word, no. ;)Happy to help though.Phil Brammer | http://www.ssistalk.com | Twitter: http://twitter.com/PhilBrammer
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 6:12pm

Hey Phil .. I see here they said you know everything ... Do you know why I have fails on this .. It is telling me CHAR function does not exist ...Do you have idea how I can replace CRLF .. (DT_STR,{1},1252)(TRIM(REPLACE([{0}],CHAR(13),''))
September 1st, 2012 10:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics