cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:Mapping

Former Member
0 Kudos

Hi...

I am having an input file as shown below.

Record --- 1 to unbounded

Field1--- Test1

Field2 --- Test2

Field3 --- YTest3 -(Length -142) YTest4-- (Length -142) YTest4---- (Length -142)YTest5 --- (Length -NTest6 -- (Length -142)142)

In the above structure, The Record is repeating. In the Record 3 fields are there. The third field is having data like YTest3,YTes4,YTest5,NTest6. In that if the starting value is Y, then we can say that next Statement is present. If the starting value is N, then that satement ends and the field3 will be ended.

In the Target i need to map like

Record --- 1 to unbounded

Statement1 -


YTest3

Statement2 --- YTest4

Statement3 -


YTest5

Statement4 --- NTest6

Can you please help in mapping.

Thanks & Regards,

Leela

Can

Accepted Solutions (0)

Answers (3)

Answers (3)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Leela,

There is no need to check if first character is a Y or N if you'll be using a UDF splitter based on a "comma".

See code below:

UDF type is context

argument is input


String b[] = input[0].split(",");
for (int a=0;a<b.length;a++){result.addValue(b[a]);}

FIELD3 --> UDF --> Target (1..unbounded)

Let me know if this works,

Regards,

Edited by: Mark Dihiansan on Mar 12, 2009 1:55 PM

Edited by: Mark Dihiansan on Mar 12, 2009 1:57 PM

Former Member
0 Kudos

Hi

First we need to capture the occurence of the target (Statement - 0 .. ountbound) node.

For this we need to first get the entire element data of "FIELD3" and check number of element starting with T + N.

After that we need to split each value and mapp accordingly

any ideas

Srini

Former Member
0 Kudos

Hi....

Can you explain it in detail....

Regards,

Leela

siddhesh_pathak4
Contributor
0 Kudos

I hope you have the field3 with you in mapping you just need to divide this according to length.

and mapp it to the target field. No need to check with Y or N. In mapping use standard function Exists while mapping to target fields.

like field3(substring(0,142)) ->Exists->targetField..

siddhesh_pathak4
Contributor
0 Kudos

Hi,

Just divide the field3 like, map statement1 with field3 substring(0,142), statement2 with field(142,284) and so on... If you want use mapWithDefaultValue or Exists.