Hi,
I have a column DESC_ which has values like the below one
DESC_
-----------
ABC
ABCXYZ
XYZ
NULL
ZZZAAABBB
I need to append comma after every 3 character.
DESC_
-----------
ABC
ABC,XYZ
XYZ
NULL
ZZZ,AAA,BBB
Please hint me with some logic to accomplish this.
Many Thanks
MSR
To find out the substring and concat with field separator
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 83
- Joined: Tue Oct 28, 2008 1:55 am
- Location: Chennai
To find out the substring and concat with field separator
The minute you start talking about what you're going to do if you lose, you have lost
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use a BASIC Transformer stage and the following expression:
or this one:
Code: Select all
Convert(@FM, ",", Fold(InLink.DESC_, 3))
Code: Select all
Convert(@TM, ",", Fmt(InLink.DESC_, "3L"))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: