on 10-16-2006 10:17 PM
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
Hi Bill,
Thanks for your prompt reply. What character should be used for the tab delimiter in communication channel?
Best regards,
Chi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.