split a string
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3
- Joined: Tue Oct 23, 2007 11:57 pm
If you want to execute the substring operation through transformer then below is an example what you can refer.
Input1 - column name
expression in the transformer stage expression editor.
Input1[1,3]
note: 1 is the starting position and 3 is the string length.
if your Input1 data is "SUBSTRING". After passing through the transformer it will result as "SUB".
Hope this helps......
Input1 - column name
expression in the transformer stage expression editor.
Input1[1,3]
note: 1 is the starting position and 3 is the string length.
if your Input1 data is "SUBSTRING". After passing through the transformer it will result as "SUB".
Hope this helps......
Masters are never born. But they become one by experience.
lokesh_vee wrote:If you want to execute the substring operation through transformer then below is an example what you can refer.
Input1 - column name
expression in the transformer stage expression editor.
Input1[1,3]
note: 1 is the starting position and 3 is the string length.
if your Input1 data is "SUBSTRING". After passing through the transformer it will result as "SUB".
Hope this helps......
i want it as SUB STRING(ie space in between) and not only SUB
Simply use Input1[1,3]:' ':Input1[4,LEN(Input1)-3]abhay10 wrote:lokesh_vee wrote:If you want to execute the substring operation through transformer then below is an example what you can refer.
Input1 - column name
expression in the transformer stage expression editor.
Input1[1,3]
note: 1 is the starting position and 3 is the string length.
if your Input1 data is "SUBSTRING". After passing through the transformer it will result as "SUB".
Hope this helps......
i want it as SUB STRING(ie space in between) and not only SUB
The criteria was implied that the split happened between the 3rd and 4th character.gateleys wrote:That's if your input data is to be ALWAYS split with 3 characters in the first word followed by a space and rest of the characters.NickH wrote: Simply use Input1[1,3]:' ':Input1[4,LEN(Input1)-3]
What is your criteria for splitting a word into 2?
As there are many ways to do it, this was just an example that could be adjusted easily, I prefer to start simple and work up to complex
If you want to get more interesting you could go for
where v_LenStartString is the length of the first part of the string
Then it would be
Input1[1,v_LenStartString]:' ': Input1[(v_LenStartString+1),LEN(Input1)-v_LenStartString]
or perhaps
EReplace(Input1,Input1[1,v_LenStartString],Input1[1,v_LenStartString]:' ',1,1)
but I prefer simple as its easier to maintain in the long run
Me too... like this one -NickH wrote: I prefer simple as its easier to maintain in the long run
Code: Select all
Fmt(Arg1,"L#3 #":Len(Arg1)-3)
gateleys
DSguru2B wrote:Guys, lets not carried away, both EREPLACE() and FMT() do not exist in px. Lets wait for the OP to come back with a rule.
Gotta get one of those Server To Parallel Transition Trainings. Any idea if there is one in the near future.
But what's the point? We don't have an EE here.
gateleys