Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett , rschirm , roy
harryhome
Participant
Posts: 112 Joined: Wed Oct 18, 2006 7:10 am
Post
by harryhome » Thu Apr 03, 2014 2:03 pm
Hi need to replace consecutive space by one single space.
Code: Select all
Input string: "THIS IS TEST STRING"
Desired out put: "THIS IS TEST STRING"
is there any way to do this in transformer in 7.5
[Note - Code Tags added to preserve whitespace - Andy]
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Apr 03, 2014 2:50 pm
Those two strings look the same to me.
[Andy, Andy, Andy]
The forum software removes any 'extra' spaces automatically... you'd need to use
Code: Select all
tags in order to preserve them in any posted examples.
Did you check your documentation for the permutations of the "Trim" function? Don't recall what it supported back in the 7.5 days.
Last edited by
chulett on Mon Apr 07, 2014 7:10 am, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Thu Apr 03, 2014 3:12 pm
Trim() function with a single argument (the string on which to operate)removes leading, trailing and redundant whitespace characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Apr 03, 2014 3:15 pm
Knew it did on the Server side of the world, wasn't sure enough about the Parallel side to make that same assertation without access to my docs.
-craig
"You can never have too many knives" -- Logan Nine Fingers
moalik
Participant
Posts: 39 Joined: Thu Sep 15, 2011 8:15 am
Location: Melbourne
Post
by moalik » Mon Apr 07, 2014 12:23 am
Hi Harry,
You can use the "CompactWhiteSpace(%string%)" function in the transformer and pass the column as input to it.
Example: CompactWhiteSpace(DSLink.Designation)
if the data is in format :
Input string: "THIS IS TEST STRING"
Desired out put: "THIS IS TEST STRING"
Mohsin Khan
Datastage Consultant