Page 1 of 1

Posted: Wed Nov 21, 2007 5:11 am
by ray.wurlod
Using the appropriate functions in a Modify stage or a Transformer stage.

Posted: Wed Nov 21, 2007 5:13 am
by abhay10
ray.wurlod wrote:Using the appropriate functions in a Modify stage or a Transformer stage. ...

i know that, but which function?

Posted: Wed Nov 21, 2007 5:29 am
by lokesh_vee
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......

Posted: Wed Nov 21, 2007 5:33 am
by abhay10
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

Posted: Wed Nov 21, 2007 8:59 am
by DSguru2B
Use the LEFT() and RIGHT() functions in the transformer stage and concatenate a space in between.

Posted: Wed Nov 21, 2007 10:10 am
by NickH
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
Simply use Input1[1,3]:' ':Input1[4,LEN(Input1)-3]

Posted: Wed Nov 21, 2007 10:16 am
by gateleys
NickH wrote: Simply use Input1[1,3]:' ':Input1[4,LEN(Input1)-3]
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.

What is your criteria for splitting a word into 2?

Posted: Wed Nov 21, 2007 10:56 am
by NickH
gateleys wrote:
NickH wrote: Simply use Input1[1,3]:' ':Input1[4,LEN(Input1)-3]
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.

What is your criteria for splitting a word into 2?
The criteria was implied that the split happened between the 3rd and 4th character.

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 :wink:

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

Posted: Wed Nov 21, 2007 1:27 pm
by gateleys
NickH wrote: I prefer simple as its easier to maintain in the long run
Me too... like this one -

Code: Select all

Fmt(Arg1,"L#3 #":Len(Arg1)-3)
:wink:

Posted: Wed Nov 21, 2007 2:12 pm
by DSguru2B
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.

Posted: Wed Nov 21, 2007 2:37 pm
by 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.
:oops: :oops:

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.

Posted: Wed Nov 21, 2007 11:08 pm
by abhay10
thanks everyone i got it by concatenating space using left and right...