Five Stars

how to use same input with 2 record types to map to single output

Hello, 

I have input with 2 record types, number of columns are different in both

HEADER h1b hcc hcd    
LINE h1lb h1lc h1ld h1le h1lf
HEADER h2b h2c h3d    
LINE h2lb h2lc h2ld h2le h2lf
LINE h2l2 h2lc h2ld h2le h2lf

 

I would like the mapped output to end like

HEADER~h1b~hcc~hcd
LINE~h1lb~h1lc~h1ld~h1le~h1lf
HEADER~h2b~h2c~h3d
LINE~h2lb~h2lc~h2ld~h2le~h2lf
LINE~h2l2~h2lc~h2ld~h2le~h2lf

How can I ignore the 2 additional columns for HEADER or is there a way to use 2 different input schema from input for the same input data?

the current output is 

HEADER~h1b~hcc~hcd~~
LINE~h1lb~h1lc~h1ld~h1le~h1lf
HEADER~h2b~h2c~h3d~~
LINE~h2lb~h2lc~h2ld~h2le~h2lf
LINE~h2l2~h2lc~h2ld~h2le~h2lf

 

Thank you in advance for any suggestion/guidance.

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: how to use same input with 2 record types to map to single output

Thank you cterenzi. Thats helpful. However I had to use excel as input.

I was able to use 2 tMaps followed by a tFilterRow dumping to 2 tFileOutputDelimited but both use the same output file, so it dumps HEADER and LINE to same file.

split.jpg

 

 

2 REPLIES
Ten Stars

Re: how to use same input with 2 record types to map to single output

There is a tFileInputMSDelimited component which can handle multiple schemas in one file.  I've included a link to the component documentation which includes an example below:

tFileInputMSDelimited

Five Stars

Re: how to use same input with 2 record types to map to single output

Thank you cterenzi. Thats helpful. However I had to use excel as input.

I was able to use 2 tMaps followed by a tFilterRow dumping to 2 tFileOutputDelimited but both use the same output file, so it dumps HEADER and LINE to same file.

split.jpg