on 05-23-2014 4:35 PM
Hi
I have a text as sample below and needs to mapped to target. It is not coming from source. it is constant.How can I get in separate line after each terms and condtions in target
I tried with adding everthing in constant not getting expected. Theser are up to 17 nos .Can it be done with graphical mapping ?
0, some text fsfdfdsdfsfsfsfsf
1, (1) some textdfssfsdfssffssfd
2, (2) some textdsfsdffssffsdfsfdfffffffffffffff
3, (3)some textsdfsfsdsfffffffffffffffffffffffffffffffffffffffffffffffffffff
Expected in the target format in field
some text fsfdfdsdfsfsfsfsf
(1) some textdfssfsdfssffssfd
(2) some textdsfsdffssffsdfsfdfffffffffffffff
.
.
(16) some text dfdfsfsffsfssssssssss
Thanks
Mahesh
Hi Mahesh,
you can use the udf in message mapping to add the line feed. Add the delimeter in the input (| in below example code) and then udf will replace | with line feed.
/**
@param inputRes input values to be filtered
*/
AbstractTrace trace = container.getTrace();
trace.addDebugMessage ("Debuggggggggggggg....TTT " + inputRes[0]);
char[] cArray = inputRes[0].toCharArray();
inputRes[0] = "";
for (int i=0;i<cArray.length;i++) {
if (cArray[i] == '|' && cArray[i+1] == '|') {
cArray[i] = '\n'; /* replace first | with line feed */
inputRes[0] = inputRes[0] + cArray[i];
i = i +1; /* remove second | */
}
else {
inputRes[0] = inputRes[0] + cArray[i];
}
trace.addDebugMessage ("Debuggggggggggggg.... TTT " + inputRes[0]);
}
result.addValue(inputRes[0]);
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mahesh Kumar,
In Message Mapping write one UDF without any input parameters and add below line in your UDF. This will generate output text in multiple lines. You can't see this output in message mapping test tab but in target file it will generate in new line.
return "some text fsfdfdsdfsfsfsfsf \n"+" (1) some textdfssfsdfssffssfd."+"\n"+"(2) some textdsfsdffssffsdfsfdfffffffffffffff.";
Regards
Sateesh
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 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.