cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter Content Conversion

Former Member
0 Kudos

Hi all,

I got following sample flat file input, can we convert it to XML in file adapter' file content conversion?

Key1,Key2,Item1,Item2,Item3

0001,AAA1,001,Cup,100

0001,AAA1,002,Glass,100

0002,BBB1,001,TV,10000

0002,BBB1,002,Radio,100

<Orders>

<Order>

<Key1>0001</Key1>

<Key2>AAA1</Key2>

<Item>

<Item1>001</Item1>

<Item2>Cup</Item2>

<Item3>100</Item3>

</Item>

<Item>

<Item1>002</Item1>

<Item2>Glass</Item2>

<Item3>100</Item3>

</Item>

</Order>

<Order>

<Key1>0002</Key1>

<Key2>BBB1</Key2>

<Item>

<Item1>001</Item1>

<Item2>TV</Item2>

<Item3>100000</Item3>

</Item>

<Item>

<Item1>002</Item1>

<Item2>Radio</Item2>

<Item3>100</Item3>

</Item>

</Order>

</Orders>

Best regards,

chi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bill,

Thanks for your prompt reply. What character should be used for the tab delimiter in communication channel?

Best regards,

Chi

Former Member
0 Kudos

Try to use \t as the delimiter for tab.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Please do it in two steps.

1) in content converion

<Orders>

<Order>

<Item>

<Item1>001</Item1>

<Item2>Cup</Item2>

<Item3>100</Item3>

</Item>

<Item>

<Item1>002</Item1>

<Item2>Glass</Item2>

<Item3>100</Item3>

</Item>

</Order>

<Order>

<Key1>0002</Key1>

<Key2>BBB1</Key2>

<Item>

<Item1>001</Item1>

<Item2>TV</Item2>

<Item3>100000</Item3>

</Item>

<Item>

<Item1>002</Item1>

<Item2>Radio</Item2>

<Item3>100</Item3>

</Item>

</Order>

</Orders>

2)

in second step add these keys

<Orders>

<Order>

<Key1>0001</Key1>

<Key2>AAA1</Key2>

<Item>

<Item1>001</Item1>

<Item2>Cup</Item2>

<Item3>100</Item3>

</Item>

<Item>

<Item1>002</Item1>

<Item2>Glass</Item2>

<Item3>100</Item3>

</Item>

</Order>

<Order>

<Key1>0002</Key1>

<Key2>BBB1</Key2>

<Item>

<Item1>001</Item1>

<Item2>TV</Item2>

<Item3>100000</Item3>

</Item>

<Item>

<Item1>002</Item1>

<Item2>Radio</Item2>

<Item3>100</Item3>

</Item>

</Order>

</Orders>

regards,

wojtek

Former Member
0 Kudos

Hi Wojtek,

Can you please explain how I can do 2 steps in Content Conversion?

Thanks,

Chi

Former Member
0 Kudos

Hi,

First part is done in content conversion and the second in normal graphical mapping (in interface mapping you can have sequence of message mapping).

Regards,

wojtek

Former Member
0 Kudos

Hi,

Not exactly, but can have a similar result with more storage used:-)

<Orders>

<Order>

<Item>

<Key1>0001</Key1>

<Key2>AAA1</Key2>

<Item1>001</Item1>

<Item2>Cup</Item2>

<Item3>100</Item3>

</Item>

<Item>

<Key1>0001</Key1>

<Key2>AAA1</Key2>

<Item1>002</Item1>

<Item2>Glass</Item2>

<Item3>100</Item3>

</Item>

</Order>

<Order>

<Item>

<Key1>0002</Key1>

<Key2>BBB1</Key2>

<Item1>001</Item1>

<Item2>TV</Item2>

<Item3>100000</Item3>

</Item>

<Item>

<Key1>0002</Key1>

<Key2>BBB1</Key2>

<Item1>002</Item1>

<Item2>Radio</Item2>

<Item3>100</Item3>

</Item>

</Order>

</Orders>

Regards,

Bill