cancel
Showing results for 
Search instead for 
Did you mean: 

Challange with message split

Former Member
0 Kudos

Hi All.

I have to create a several files from one file according to the customer number

and I have to attach the right reference to the right customer positon number

let say I have the follwong file

<libarary>

<customer>

<pos>1</pos>

<nr>1</nr>

</customer>

<customer>

<pos>2</pos>

<nr>1</nr>

</customer>

<customer>

<pos>3</pos>

<nr>2</nr>

</customer>

<customer>

<pos>4</pos>

<nr>2</nr>

</customer>

<references>

<ref>1</ref>

<ref>2</ref>

<ref>3</ref>

<ref>4</ref>

</references>

</libarary>

according to the requirement I have to create 2 files , one for customer 1 and one for customer 2.

this is can be achieved by using split by value function to create 2 or more files , but my the challenge is how can I attache the ref field to the right pos field.

which means ref 1 and ref 2 should go to the file with pos 1 and pos 2 and ref 3 and ref 4 should go to the file with pos 3 and pos 4

the finale result should be like this

File 1

<File>

<customer>

<pos>1</pos>

<nr>1</nr>

</customer>

<customer>

<pos>2</pos>

<nr>1</nr>

</customer>

<references>

<ref>1</ref>

<ref>2</ref>

</references>

</File>

File 2

<File>

<customer>

<pos>3</pos>

<nr>2</nr>

</customer>

<customer>

<pos>4</pos>

<nr>2</nr>

</customer>

<references>

<ref>3</ref>

<ref>4</ref>

</references>

</File>

Any help will be higly apreciated

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You have make sure all the levels properly mapped:

libarary/customer/nr -> removeConext() ->splitByvalue[ValueChange] -> CollapsContext() -> File

libarary/customer/nr -> removeConext() ->splitByvalue[ValueChange] -> customer

libarary/customer/nr -> removeConext() ->splitByvalue[ValueChange] -> CollapsContext() -> SplitByvalue[each value] -> File/customer/references

reference/ref----


>

FormatByExample() -> ref

libarary/customer/nr -> removeConext ->splitByvalue[ValueChange]-->

libarary/customer/nr -> File/customer/nr

Liang

Former Member
0 Kudos

Hi Liang and Luis

Problem solved with your help . thanks a lot

I had thoug to change the

libarary/customer/nr -> removeConext() ->splitByvalueValueChange -> CollapsContext() -> SplitByvalueeach value -> File/customer/references

to

libarary/customer/nr -> removeConext() ->splitByvalueValueChange -> File/customer/references

Cheers and keep on the good work.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi.Merhej

Try this

Reference\ref -


>

-


> formatByExample -


>Target.

Customer\r1-->removeContext -


>SplitByValue (ValueChange)>

Luis Ortiz