February 11, 2011 at 7:23 am
Iam importing a text file and splitting the data on commas, this is being done by using a derived column, the problem i am encountering is that some of the column data also has commas in it, this data is enclosed by double quotes. An example is show below
15,"I",201,9991,"TEST","TEST,1","TEST2","TEST3","TEST4"
"TEST,1" needs be in one column not split.
the code i am using at the moment is
(SUBSTRING(Line,FINDSTRING(Line,",",5) + 1,FINDSTRING(Line,",",6) - FINDSTRING(Line,",",5) - 1)).
the code has to be done this way for different reasons.
Has anybody got some derived column code that will overcome this problem
Any help will be most appreciated:-)
February 11, 2011 at 7:36 am
I believe you can just state in your Flat File connection uses the comma as a column delimeter and the double quote as a text qualifier.
That way you won't have to mess with the derived column.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply