on 03-28-2013 7:39 AM
Hi All,
please help me on this logic , as i am not good at java
tried for the logic but not able to generate exact result.
Here is the requirement:
when ever there is a space in the input queue i need to pass the value which is before space i.e., here 3,6,7 are the values that
exists before space and pass it to the spaced values
here in input queue you see that after 3 value there are two spaces so i need to pass two 3 values in the spaced values
and after six there are two spaces then we need to pass two 6 values in the spaced values
and at last after 7 there is one space and i need to pass one 7 value and so on..
Suppose i have the values in the input Queue as
input Queue
1
2
3
5
6
7
8
my requirement is to generate the result as
Ouput Queue as
1
2
3
3
3
5
6
6
6
7
7
8
please help me on this.
Thanks
Sai
Hello,
Use this UDF:
Input = var1
Execution type: all values of a context
String a = "";
for(int i=0;i<var1.length;i++)
{
if(!var1[i].equals(""))
{
result.addValue(var1[i]);
a = var1[i];
}
else
result.addValue(a);
}
Thanks
Amit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.