on 02-15-2010 8:43 AM
Hello All,
I dont have knowledge in java code, so iam posting this Q.
I have one requirement.
i have 50 line of data in any of the line contain key word say as DOCTYPE then i need to remove the line and send space to the target side.
iam using file adater at sender side and grahical mapping.
how to achive this. Please send the java code.
Thanks n Regards,
Chinna
Hi Chinna
Could you please elaborate a bit on your requirement.
Do you have a flat-file in source with 50 lines in it?
If so no need to use UDF for this. Just use ifWithoutElse to the target node in graphical mapping.
Source field-> If(DOCTYPE) then (blank contant) -> target NODE
Incase there's no DOCTYPE teh node would be suppressed for that instance automatically.
Regards
Soumen...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi chinna,
i have 50 line of data in any of the line contain key word say as DOCTYPE then i need to remove the line and send space to the target side.
Step1: map the source element to the udf.
step2:UDF
All value of conext
input:records,result,container
output:void
udf code:
-
for(int i=0;i<records.length;i++)
{
if(records<i>.contais("DOCTYPE"))
result.addValue(" ");// u can specify the number of spaces if u want more to be in target. If u want only.
result.addValue(records<i>); // This is default else condition adding the contents tio target.
}
-
Please change the context of source to parent.
I hope this will solve ur prblm
Babu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have 50 line of data in any of the line contain key word say as DOCTYPE then i need to remove the line and send space to
the target side.
DOCTYPE will be in some node of the DT that you define in IR.
Node -->
-->equalS --> IfWithoutElse (Then --> Constant_with_SPACE as parameter) --> Target
Constant(DOCTYPE)-->
UDF will be required if you are not sure about the position of DOCTYPE in the node....i.e. if DOCTYPE has some characters before/ after it.
In the above logc you will have to take care of Context if the node will be repeating.
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use IF without Else for the line & send Constant Space, if the condition is True.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.