[resolved] Convert EXCEL into XML while re-organize similar items together

One Star

[resolved] Convert EXCEL into XML while re-organize similar items together

Hi everyone,
I need help on the following. Can you please tell me if i can do the following transformation?
Convert my excel file into an XML file while re-organizing and re-structure similar items together. (Hope my example is good)
Excel file:

A B C D E
1 Make Series Engine Chassis Owner
-----------------------------------------------------------------
2 BMW 1 1.5 Hatchback Smith John
3 BMW 3 1.5 Sedan Foster Carl
4 Mercedes SLK 3.0 Coupe Ulrich Stan
5 Audi A6 1.6 Sedan Barnes Steve
6 Audi A3 1.6 Sedan Anderson Kevin
7 BMW 1 1.5 Hatchback Hart Bill

The XML file:
<type version="1.0">
<value label="BMW">
<value label="1">
<value label="1.5">
<value label="Hatchback">
<value label="Smith John"/>
<value label="Hart Bill"/>
</value>
</value>
</value>
<value label="3">
<value label="1.5">
<value label="Sedan">
<value label="Foster Carl"/>
</value>
</value>
</value>
</value>
<value label="Audi">
<value label="A6">
<value label="1.6">
<value label="Sedan">
<value label="Barnes Steve"/>
</value>
</value>
</value>
<value label="A3">
<value label="1.6">
<value label="Sedan">
<value label="Anderson Kevin"/>
</value>
</value>
</value>
</value>
<value label="Mercedes">
<value label="SLK">
<value label="3.0">
<value label="Coupe">
<value label="Ulrich Stan"/>
</value>
</value>
</value>
</value>
</type>
Rgds,
B

Accepted Solutions
Community Manager

Re: [resolved] Convert EXCEL into XML while re-organize similar items together

Hello
Yes, it is possible, please see my demo job.
in.csv:

BMW;1;1.5;Hatchback;Smith John
BMW;3;1.5;Sedan;Foster Carl
Mercedes;SLK;3.0;Coupe;Ulrich Stan
Audi;A6;1.6;Sedan;Barnes Steve
Audi;A3;1.6;Sedan;Anderson Kevin
BMW;1;1.5;Hatchback;Hart Bill

out.xml:
<?xml version="1.0" encoding="ISO-8859-15"?>
<type version="1.0">
<value label="Audi">
<value label="A3">
<value label="1.6">
<value label="Sedan">
<value label="Anderson Kevin"/>
</value>
</value>
</value>
<value label="A6">
<value label="1.6">
<value label="Sedan">
<value label="Barnes Steve"/>
</value>
</value>
</value>
</value>
<value label="BMW">
<value label="1">
<value label="1.5">
<value label="Hatchback">
<value label="Smith John"/>
<value label="Hart Bill"/>
</value>
</value>
</value>
<value label="3">
<value label="1.5">
<value label="Sedan">
<value label="Foster Carl"/>
</value>
</value>
</value>
</value>
<value label="Mercedes">
<value label="SLK">
<value label="3.0">
<value label="Coupe">
<value label="Ulrich Stan"/>
</value>
</value>
</value>
</value>
</type>

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] Convert EXCEL into XML while re-organize similar items together

Hello
Yes, it is possible, please see my demo job.
in.csv:

BMW;1;1.5;Hatchback;Smith John
BMW;3;1.5;Sedan;Foster Carl
Mercedes;SLK;3.0;Coupe;Ulrich Stan
Audi;A6;1.6;Sedan;Barnes Steve
Audi;A3;1.6;Sedan;Anderson Kevin
BMW;1;1.5;Hatchback;Hart Bill

out.xml:
<?xml version="1.0" encoding="ISO-8859-15"?>
<type version="1.0">
<value label="Audi">
<value label="A3">
<value label="1.6">
<value label="Sedan">
<value label="Anderson Kevin"/>
</value>
</value>
</value>
<value label="A6">
<value label="1.6">
<value label="Sedan">
<value label="Barnes Steve"/>
</value>
</value>
</value>
</value>
<value label="BMW">
<value label="1">
<value label="1.5">
<value label="Hatchback">
<value label="Smith John"/>
<value label="Hart Bill"/>
</value>
</value>
</value>
<value label="3">
<value label="1.5">
<value label="Sedan">
<value label="Foster Carl"/>
</value>
</value>
</value>
</value>
<value label="Mercedes">
<value label="SLK">
<value label="3.0">
<value label="Coupe">
<value label="Ulrich Stan"/>
</value>
</value>
</value>
</value>
</type>

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Convert EXCEL into XML while re-organize similar items together

Thanks
You and Talend are great
B.
One Star

Re: [resolved] Convert EXCEL into XML while re-organize similar items together

i am not able to create group element and group in rest of the fields can some one guide me
Community Manager

Re: [resolved] Convert EXCEL into XML while re-organize similar items together

i am not able to create group element and group in rest of the fields can some one guide me

You must create a loop element first, and then create a group element.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Convert EXCEL into XML while re-organize similar items together

HI guy..
please help me..
I want to convert my XML file into Excel without using any third party software, can it be possible using TALEND