Skip to Content
author's profile photo Former Member
Former Member

File Adapter Content Conversion

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 09:23 PM

    Hi Bill,

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

    Best regards,

    Chi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 09:23 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 09:19 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.