Generate flat file with Header and Lines from 2 Readers

More
4 years 1 month ago #21925 by BPO
Thank you Peter !
Would be great that you add examble en "Examples (text file)" section in the test DB for next release.

Also can I ask you an example if we want do the same transformation to get Header / Line.
But from only one reader, then source data is only one file as bellow :

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

to get :

HEAD01
Line1
Line2
HEAD02
Line4
Line5
HEAD03
Line3

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

More
4 years 1 month ago #21926 by admin
We usually post examples here so everyone can find them
index.php?option=com_content&view=category&id=108&Itemid=17/
We were planning to post the one we created for you but just have not had a chance to do it

Anyway regarding your question.

We have created another example for you I hope you will find it useful


Mike
ETL Architect
Attachments:

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

More
4 years 1 month ago #21927 by BPO
Thank you for your help and kind examples, they are really usefull.

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

More
More
4 years 3 weeks ago #21938 by BPO
There is one more thing I am trying with this transformation but without success unfortunately...

The output fil is then all right now :

HEAD1;01
LINE3;01
LINE4;01
HEAD2;02
LINE1;02
LINE2;02

What I am trying is to generate one file per Header then this way :

file1 :
HEAD1;01
LINE3;01
LINE4;01

file2 :
HEAD2;02
LINE1;02
LINE2;02

I have tried by the system file writer using Output Name but it write only last line in the file name.
Can you please help in a way of doing it.

Thx

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

More
4 years 3 weeks ago #21939 by admin
Default repository has an example called Dynamic File names 2

Check it out

It Creates a new separate file for every year
the year is a part of the file name

In your case the year would be the header

You would need to convert the input into

HEAD1;01;HEAD1
LINE3;01;HEAD1
LINE4;01;HEAD1
HEAD2;02;HEAD2
LINE1;02;HEAD2
LINE2;02;HEAD2

This can be quickly done using the "Keep value" transformation function

/wiki/advanced-etl-processor/transformation-functions/miscellaneous/keep-value/

Mike
ETL Architect

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

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save