[resolved] split excel file in several xml files

Six Stars

[resolved] split excel file in several xml files

Hello!
What I want is to split some excel content into several xml files separated by dept.
I have an excel file with 3 columns
dept, name, email
sales, jonh, jonh@domain.com
sales, sarah, sarah@domain.com
mkt, sue, sue@domain.com
mkt, peter, peter@domain.com
warehouse, etc, etc@domain.com
The problem is the the result is 3 files separated by dept, but only with 1 name and 1 email by dept in each file.
I should have sales.xml with to results, and I only have john... and so on...
This kind of job works if I separate to txt files.
Any idea?
Thanks in advance

Accepted Solutions
Seventeen Stars

Re: [resolved] split excel file in several xml files

I guess the list of departments are fix and do not change every day.
I would do following:
tFileInputExcel ---- tMap ----- (one output for every department) ---- tFileOutputXML
In the tMap you can define for every output a filter (e.g. "sales".equals(row1.dept) )
I would write it in this way, because this way you don't have to deal with empty or null values.

All Replies
Seventeen Stars

Re: [resolved] split excel file in several xml files

I guess the list of departments are fix and do not change every day.
I would do following:
tFileInputExcel ---- tMap ----- (one output for every department) ---- tFileOutputXML
In the tMap you can define for every output a filter (e.g. "sales".equals(row1.dept) )
I would write it in this way, because this way you don't have to deal with empty or null values.
Six Stars

Re: [resolved] split excel file in several xml files

Hello jlolling!
Yes you are right, and the departments don't change every day.
Thanks for your help, but i found other solution.
Regarding the picture, as you can see, with the tflow, and a xml file name by department name, I am splitting the excel data in several files. The problem was on the xml. With the right loop element and group, the result was perfect!
Thank you!