Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS Package to remove Tab spaces in destination flat file. Expand / Collapse
Author
Message
Posted Tuesday, April 23, 2013 7:56 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, October 16, 2013 8:31 PM
Points: 18, Visits: 117
Hi,

I am creating an ssis package to remove tab's from the source flat file and send it to destination flat file.
In control flow i used data flow task in data flow i used source flat file, connected it to the source flat file on my desktop.
used derived column transformation, in the expression i used TRIM function but it is trimming the spaces too.. i want spaces in the column.


Please help!!
Post #1445746
Posted Wednesday, April 24, 2013 11:00 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, July 24, 2014 8:41 AM
Points: 2,818, Visits: 2,553
Have you tried using Replace?
Post #1446122
Posted Wednesday, April 24, 2013 11:20 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, October 16, 2013 8:31 PM
Points: 18, Visits: 117
yes i tried it by using expression replace([column 0],"/t"," ") dint work.

Thanks
Post #1446130
Posted Wednesday, April 24, 2013 11:21 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, October 16, 2013 8:31 PM
Points: 18, Visits: 117
sorry i used this "\t"
Post #1446131
Posted Wednesday, April 24, 2013 11:34 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, July 24, 2014 9:07 AM
Points: 11,157, Visits: 12,899
shrsan (4/24/2013)
sorry i used this "\t"


Are you sure it is a horizontal tab ("\t")? Sounds like it might be another white space character. I'd through in a column in the derived column or columns transform that use FINDSTRING() to find out what type of characters are in the source column for real. Something like:

FINDSTRING("\t", column, 0) > 0 ? "Tab Found" : "No Tab Found"

You could do a new column for the most common whitespace characters or nested IF's, or you could use a script task and use .NET to find what characters are really there and do the replace using .NET.

Finally you could get the SSIS RegEx transform and use it, http://www.sqlis.com/post/Regular-Expression-Transformation.aspx




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1446139
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse