cancel
Showing results for 
Search instead for 
Did you mean: 

help on a requirement.

Shabarish_Nair
Active Contributor
0 Kudos
335

Hi all,

We have a situation where a flat file looks somewhat like the following:

name,age

city,country

id,number

dept,wing

now in the flat file the input may vary as shown below....

name,age

city,country

id,number

dept,wing

name1,age1

city1,country1

id1,number1

dept1,wing1

or

name,age

city,country

id,number

dept,wing

name1,age1

city1,country1

name2,age2

city2,country2

or

id,number

dept,wing

id1,number1

dept1,wing1

name,age

city,country

or

name,age

city,country

name1,age1

city1,country1

or

id,number

dept,wing

id1,number1

dept1,wing1

hence in short the (name,age) will always be folllowed by (city,country) and (id,number) by (dept,wing) but the combinations occur in random ie name,age & city,country may come before the id,number & dept,wing or vice versa.

how do we go about in such a scenario.

regards,

ShabZ

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member605561
Participant
0 Kudos

Hi Vijay

You should have a key field for each record to identify the type of record.Even thought the combinations are random, the key fields identifies the record and you can create the XML file accodingly.

for eg: key1,name,age

key2,city,country

key3,id,number

key4,dept,wing

key1,name,age

key2,city,country

key3,id,number

key4,dept,wing

key1,name1,age1

key2,city1,country1

key1,name2,age2

key2,city2,country2

Regards

Suneel

Shabarish_Nair
Active Contributor
0 Kudos

Hi Suneel,

I had forgotten to mention about the key fields. Of course we do make use of key fields.

But when the combinations occur in random, how do we define its content conversion and mapping.

ShabZ

Shabarish_Nair
Active Contributor
0 Kudos

Hi,

The problem is now resolved.

Regards,

ShabZ

Former Member
0 Kudos

Shabarish,

Would you mind sharing how you resolved the issue. might benefit other forum members as well.

regards,

Sapknowledge

Shabarish_Nair
Active Contributor
0 Kudos

Hi,

The trick lies in defining the source data type.

it may look something like this,

Dt_input

|

Details (0-Unbounded)

|_title (0-Unbounded)

|_name

|_age

|_info(0-Unbounded)

|_city

|_country

|_tag(0-Unbounded)

|_id

|_number

|_node(0-Unbounded)

|_dept

|_wing

and during content conversion, give the recordset as Details and the recordset structure as title,,info,,tag,,node,

and specify the recordset per message as *.

This wud help things out.

Regards,

Shabarish & Prasad.

Former Member
0 Kudos

thanks for the tip Shabarish.

Shabarish_Nair
Active Contributor
0 Kudos

if you found it a good solution, guess some points cud have been alloted !!