Page 1 of 1

Merge 2 different files

Posted: Wed Oct 04, 2006 6:01 am
by kjaouhari
Hello all,

I want to merge 2 files. The first contains Header and second contains the details.

When I compile job, I have an error message : "Link Collector stage must have the same number of columns on all of its input and output..."

So shoud I use an other stage to merge 2 files ?

thanks for your help dsxians !

Posted: Wed Oct 04, 2006 6:07 am
by boppanakrishna
hi,
if you want to use Link Collector or Link Partitioner the metadata must be same in both the input and output files ..

For merging the two files you can use Merge stage,

if you have any queries regarding this you are always welcome

Thanks
Boppana Ramakrishna

Posted: Wed Oct 04, 2006 6:29 am
by ShaneMuir
Can't you just use a unix command in a before or after subroutine?

eg cat detail.txt >> header.txt

Posted: Wed Oct 04, 2006 6:32 am
by kjaouhari
Thanks for your ideas,

but with your methods I think I can't have a file with this structure:

header 1
ligne 1
ligne 2
header 2
ligne 1
ligne 2

Posted: Wed Oct 04, 2006 6:49 am
by Kirtikumar
What are contents of input header file and detail file?

To understand the output mentioned in your post, input should be specified.

Posted: Wed Oct 04, 2006 6:58 am
by kjaouhari
Header file contains description and details contains amount.

I've found a dirty solution : I use other transformer before link collector to set the same columns number :
NumHeader-NumLigne-Content

Posted: Wed Oct 04, 2006 4:37 pm
by ShaneMuir
kjaouhari wrote:Thanks for your ideas,

but with your methods I think I can't have a file with this structure:

header 1
ligne 1
ligne 2
header 2
ligne 1
ligne 2
Is there any link between the header and the detail? ie So you know which detail lines belong to which header, or is it just write header, 2 detail lines, header, 2 detail lines etc?

Posted: Thu Oct 05, 2006 7:26 am
by kumar_s
Converting into single large varchar column before Link Colelctor might also help.