cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed for splitting a file

Former Member
0 Kudos

HI,

i am getting multiple bill related data in single file.. the structure looks like below

Bill_list 1:1

-- Bill_data 1:unbounded

now i want to split the same file into single bills each.

for example say i am getting data for 2 bills in source file.then i want my output to be 2 files like

Bill_list

--Bill_data(1)

and

Bill_list

--Bill_data(2)

I tried using multimapping by changing target(same source file structure) occurance to o:unbound

and mapped

Bill_data-----> Bill_list (o:unbound)

But my file is not getting splitted into 2.. it says 2nd file cant be created.. Can you suggest where i am going wrong.

TIA

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

In your multimapping, keep the occurrence of the target structure as 0..unbounded.

Map Bill_data to the message tab, so that for each Bill_data, 1 message is created.

For the remaining mapping :

Map Bill_list to a constant 1.

Map Bill_data >splitByvalue->Bill_data

Regards

rajasekhar_reddy14
Active Contributor
0 Kudos

>

> Bill_data-----> Bill_list (o:unbound)

>

> But my file is not getting splitted into 2.. it says 2nd file cant be created.. Can you suggest where i am going wrong.

>

Above mapping wrong,just add remove context as suggested by Harish.i t will work

Harish
Active Contributor
0 Kudos

Hi,

you are mapping:

Bill_data-----> Bill_list (o:unbound)

but Bill_data is comming under Bill_list in source so there is contex changes between Bill_data. Please add remove contex in between.

Bill_data-----> Remove Context -


>Bill_list (o:unbound)

and check your target structure as well.

Regards,

Harish

former_member200962
Active Contributor
0 Kudos
it says 2nd file cant be created

where is this messsage displayed?

Can you suggest where i am going wrong

probably your target structure (occurence) needs some change as all the Bill_data tags might be generating within the first Bill_list itself.

Former Member
0 Kudos

i am testing at mapping level..the message is from there.

Yea you are rite. All Bill_data comes under one bill_list tag only..

What should be the change needed

former_member200962
Active Contributor
0 Kudos
All Bill_data comes under one bill_list tag only..

Bill_data --> Bill_List

raise the context of Bill_data to a level above source Bill_List

Does Bill_data have further sub-elements? If yes then you can map a blank constant to the target Bill_data.

Then map the sub-elements directly (or as per any business logic) to the corresponding elements under target Bill_data. check the result and confirm