February 13, 2015 at 2:02 pm
Hi ,
Some user csv's have an additional , at the end of each row. How can I trim it before the csv gets processed through the other process.
I read something about a script component but I'm not well versed with the code to be written for that.
Appreciate any help here.
Thanks,
V
February 13, 2015 at 2:17 pm
venkyzrocks (2/13/2015)
Hi ,Some user csv's have an additional , at the end of each row. How can I trim it before the csv gets processed through the other process.
I read something about a script component but I'm not well versed with the code to be written for that.
Appreciate any help here.
Thanks,
V
SELECT SUBSTRING(CsvColumn,1,LEN(CsvColumn)-1)
WHERE RIGHT(CsvColumn,1 = ','
--Jeff Moden
Change is inevitable... Change for the better is not.
February 13, 2015 at 2:36 pm
Hi Jeff,
Looks like a sql statement. What data flow transformation in SSIS would I use for this ?
Thanks,
V
February 13, 2015 at 2:38 pm
I'm in the data flow task.. I'll write a sql task in the main script and try it out.
February 13, 2015 at 4:10 pm
You don't need to remove the comma, you need to remove the column. This is done in the flat file source editor, assuming that you have an additional column that is not needed.
Is this a fixed length, delimited or ragged right?
Another option would be to use a derived column to use a derived column with something like this:
SUBSTRING( ColumnName, 1, LEN(ColumnName) - 1 )
February 13, 2015 at 4:50 pm
venkyzrocks (2/13/2015)
Hi Jeff,Looks like a sql statement. What data flow transformation in SSIS would I use for this ?
Thanks,
V
My apologies. I read the title of the post and paid no attention to the forum it was in.
I can't help here because I don't use SSIS. I do all of my ETL in T-SQL, so we'll both have to rely on someone that actually knows how to use SSIS.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2015 at 1:52 am
If you have an extra , (comma) at the end of rows in a 'csv' file. This means you have an extra column.
Just update your file connection manager and remove that extra column.
Or other way - use Derived column and remove extra , (comma)
____________________________________________________________
APFebruary 20, 2015 at 6:11 am
Yes sorry i didn't reply back to this thread earlier.
The solution is to create a new connection but not uncheck the extra column in the flat file source.
Thanks,
V
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply