#1 2007-07-27 11:00:00

Bob
Guest

How duplicate the row

Hi,

My input is a csv file. I need to produce six rows for each row in the file. How can I do it? The rows schema in the csv file must be different from the schema of the produced rows?

Thank you

#2 2007-08-01 09:57:16

nrousseau
Talend team
Registered: 2006-09-19
Posts: 119
Website

Re: How duplicate the row

One solution that you can do is for example:

Read the datas from the input file. Add a tMap, then have 6 outputs (with any schema). And in each output, you redirect to a file in append mode. (first output from the tMap don't need especially append, but others will need).

Another solution more "graphic" could be just have 6 outputs, and link them to a tUnite (to merge the data), then have only one output file.
But this solution can't work right now.

Offline

#3 2007-08-01 10:10:23

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How duplicate the row

Do I correctly understand your need if I write:

Code:

Input:

a
b
c

Code:

output

a
a
a
a
a
a
b
b
b
b
b
b
c
c
c
c
c
c

I find this need very... specific. The only clean solution I see is to create a dedicated component with IS_MULTIPLYING_OUTPUTS="true" is the XML description (see tNormalize component).

Offline

#4 2007-08-01 10:41:25

Kaisersose
Member
Company: RGI
Registered: 2007-05-07
Posts: 93

Re: How duplicate the row

nrousseau wrote:

Another solution more "graphic" could be just have 6 outputs, and link them to a tUnite (to merge the data), then have only one output file.
But this solution can't work right now.

I have tried this solution with TOS 2.1.1 and it works. I have discussed about tUnite component in the following topic : tUnite


Non fa niente...Neanch'io mi ricorderei di me stesso...

Offline

#5 2007-08-01 11:56:49

nrousseau
Talend team
Registered: 2006-09-19
Posts: 119
Website

Re: How duplicate the row

Kaisersose wrote:

nrousseau wrote:

Another solution more "graphic" could be just have 6 outputs, and link them to a tUnite (to merge the data), then have only one output file.
But this solution can't work right now.

I have tried this solution with TOS 2.1.1 and it works. I have discussed about tUnite component in the following topic : tUnite

What i mean is have like 6 outputs links from one tMap to one tUnite (so 6 links between 2 components), it's impossible right now. After the other solution works yes.

Offline

Board footer

Powered by FluxBB