Generate flat file with Header and Lines from 2 Readers

  • Posts: 51
  • Thank you received: 4

Generate flat file with Header and Lines from 2 Readers was created by BPO

Hello,

I have tried hard but cannot find the solution, any help is welcome.
I have two data (I show them as text) :

Headers file :
HEAD1;01
HEAD2;02
HEAD3;03

Lines file :
Line1;01
Line2;01
Line3;03
Line4;02
Line5;02

I want to merge them so I can generate a file with header and line as bellow :

HEAD01
Line1
Line2

HEAD02
Line4
Line5

HEAD03
Line3

Thank you !
2 months 3 weeks ago #21909

Please Log in or Create an account to join the conversation.

  • Posts: 1245
  • Karma: 3
  • Thank you received: 163

Replied by Peter.Jonson on topic Generate flat file with Header and Lines from 2 Readers

Thank you for sich a good question it will benefit many of our users.

We will create a working example for you
Peter Jonson
ETL Developer
2 months 3 weeks ago #21910

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 4

Replied by BPO on topic Generate flat file with Header and Lines from 2 Readers

Thank for your kind reply Peter

In your example it can be useful to generate the 3 section mainly used (Then from 3 reader in this case) so it will be representative for users :
Header
Line
Footer

Also other way to generate that kind of file (another good example you may do) is for the same result but from one reader, with data bellow :

HEAD01,Line1
HEAD01,Line2
HEAD02,Line4
HEAD02,Line5
HEAD03,Line3

Looking forward to your examples ! :)
The following user(s) said Thank You: Peter.Jonson
2 months 2 weeks ago #21911

Please Log in or Create an account to join the conversation.

  • Posts: 1245
  • Karma: 3
  • Thank you received: 163

Replied by Peter.Jonson on topic Generate flat file with Header and Lines from 2 Readers

Here it is.

There are multiple ways of doing it. Union is the simplest option.

Peter Jonson
ETL Developer
2 months 2 weeks ago #21912
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1245
  • Karma: 3
  • Thank you received: 163

Replied by Peter.Jonson on topic Generate flat file with Header and Lines from 2 Readers

I have attached the actual transformation for your convenience.
Peter Jonson
ETL Developer
2 months 2 weeks ago #21913
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1245
  • Karma: 3
  • Thank you received: 163

Replied by Peter.Jonson on topic Generate flat file with Header and Lines from 2 Readers

Re
HEAD01,Line1
HEAD01,Line2
HEAD02,Line4
HEAD02,Line5
HEAD03,Line3

This information can be easily created using Joiner object

www.etl-tools.com/wiki/aetle/processing_.../working_with_joiner
Peter Jonson
ETL Developer
2 months 2 weeks ago #21914

Please Log in or Create an account to join the conversation.

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies