Trim Function
Moderators: chulett, rschirm, roy
Trim Function
I have data in column like this
1)
1ABC
12ABC
123 ABC
in each record ABC present . only 3 letters.
i want output like
1
12
123
can any one help me in this?
2) Column records are
ABC1
ABC12
ABC123
I want output like
1
12
123
help me ..
1)
1ABC
12ABC
123 ABC
in each record ABC present . only 3 letters.
i want output like
1
12
123
can any one help me in this?
2) Column records are
ABC1
ABC12
ABC123
I want output like
1
12
123
help me ..
Vajranath B K
Bangalore-INDIA
Bangalore-INDIA
-
- Participant
- Posts: 437
- Joined: Fri Oct 15, 2004 6:13 am
- Location: Pune, India
As per what I got from your example - in scenario one values will be appended with ABC and second prefixed with ABC.
case 1 - Use the Index first to locate the occurence of ABC and then from input extract substring starting from 1 till (value returned by Index - 1).
case 2 - Extract the substring starting from 3 till (length of input column - 3)
case 1 - Use the Index first to locate the occurence of ABC and then from input extract substring starting from 1 till (value returned by Index - 1).
case 2 - Extract the substring starting from 3 till (length of input column - 3)
Regards,
S. Kirtikumar.
S. Kirtikumar.
howw to use substring
Kirtikumar,Kirtikumar wrote:As per what I got from your example - in scenario one values will be appended with ABC and second prefixed with ABC.
case 1 - Use the Index first to locate the occurence of ABC and then from input extract substring starting from 1 till (value returned by Index - 1).
case 2 - Extract the substring starting from 3 till (length of input column - 3)
can you guide me how to use substring ?
please give one example...
Vajranath B K
Bangalore-INDIA
Bangalore-INDIA
-
- Participant
- Posts: 222
- Joined: Tue Aug 30, 2005 2:07 am
- Location: pune
- Contact:
Hey Vajranatah,
Try out this function in Transformer stage :
Trim(Convert('ABC',' ', DSLink3.Example)).
Hi All,
This function is working and its converting multiple charcters into one specified character.
Regards
Nagesh.
Try out this function in Transformer stage :
Trim(Convert('ABC',' ', DSLink3.Example)).
Hi All,
This function is working and its converting multiple charcters into one specified character.
Regards
Nagesh.
NageshSunkoji
If you know anything SHARE it.............
If you Don't know anything LEARN it...............
If you know anything SHARE it.............
If you Don't know anything LEARN it...............
That is what the TRIM function does when the option is not specifiedNageshsunkoji wrote:Try out this function in Transformer stage :
Trim(Convert('ABC',' ', DSLink3.Example)).
This function is working and its converting multiple charcters into one specified character
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
Remember that CONVERT('ABC','',"This BCA") will return "This "; the CONVERT function works on a character-by-character basis and not on the whole string.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 222
- Joined: Tue Aug 30, 2005 2:07 am
- Location: pune
- Contact:
Hi All,
I don't know, what Miracle happened with my Datastage. The Convert function is Working for me. It's replaced the Multiple characters into one charcter. I tried by converting the 'ABC' with ' '.
I got the result without Trim function and I have used trim to remove spaces from string which are resulted due to conversion function.
Regards
Nagesh.
I don't know, what Miracle happened with my Datastage. The Convert function is Working for me. It's replaced the Multiple characters into one charcter. I tried by converting the 'ABC' with ' '.
I got the result without Trim function and I have used trim to remove spaces from string which are resulted due to conversion function.
Regards
Nagesh.
NageshSunkoji
If you know anything SHARE it.............
If you Don't know anything LEARN it...............
If you know anything SHARE it.............
If you Don't know anything LEARN it...............
In the example the CONVERT is executed before any TRIM.kumar_s wrote:Actually Trim function eliminates the given string and not the conversion.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Thanks
Trim(Convert('ABC',' ', DSLink3.Example)).Nageshsunkoji wrote:Hey Vajranatah,
Try out this function in Transformer stage :
Trim(Convert('ABC',' ', DSLink3.Example)).
Hi All,
This function is working and its converting multiple charcters into one specified character.
Regards
Nagesh.
above function works.
Thanks for all
Vajranath B K
Bangalore-INDIA
Bangalore-INDIA