- Posts: 26
- Thank you received: 0
Adding Header and Footer Data/Fields for Fixed Width Text File with Text Editor
4 years 10 months ago #18751
by cchavez
Adding Header and Footer Data/Fields for Fixed Width Text File with Text Editor was created by cchavez
I have Data Spec that requires us to have a Header Record and a Trailer Record (Footer) for a Fixed Width text file for another company’s input specification.
Question:
How do you use the Text Editor in a fixed width format specification?
Our Header and Footer file has data that is persistent and some data that is dynamic (see attachment).
Are we able to create a environment variable that we can pass into the footer and header?
I saw an example where I saw some tags <data> in an example on the Wiki but couldn’t figure out where it was pulling those variables from.
The record is a fixed block record and should be the first record on the file. Each field is fixed in length and not delimited. The field specifications are as follows:
Question:
How do you use the Text Editor in a fixed width format specification?
Our Header and Footer file has data that is persistent and some data that is dynamic (see attachment).
Are we able to create a environment variable that we can pass into the footer and header?
I saw an example where I saw some tags <data> in an example on the Wiki but couldn’t figure out where it was pulling those variables from.
The record is a fixed block record and should be the first record on the file. Each field is fixed in length and not delimited. The field specifications are as follows:
Please Log in or Create an account to join the conversation.
4 years 10 months ago - 4 years 10 months ago #18753
by admin
Mike
ETL Architect
Replied by admin on topic Adding Header and Footer Data/Fields for Fixed Width Text File with Text Editor
Hello.
We have created a working example for you,
It uses variables
Here are the screenshots.
Actual transformation:
Two metadata objects: one of the is used to get file creation date another record number
Reformat date: changes date format to YYYYMMDD as per your spec.
Running total: calculates SUM.
Left pad: pads "Record Number" with zeros.
(You would need another one for the sum of sales).
Right pad is used to pad the string to 600 characters as per your spec
and the last step sets variables values (Note variable names)
Nex step is to set header and footer
Note variables names
We do have a number of wiki articles dedicated to working with variables.
www.etl-tools.com/wiki/knowledgebase/using_variables?s []=variables
We have created a working example for you,
It uses variables
Here are the screenshots.
Actual transformation:
Two metadata objects: one of the is used to get file creation date another record number
Reformat date: changes date format to YYYYMMDD as per your spec.
Running total: calculates SUM.
Left pad: pads "Record Number" with zeros.
(You would need another one for the sum of sales).
Right pad is used to pad the string to 600 characters as per your spec
and the last step sets variables values (Note variable names)
Nex step is to set header and footer
Note variables names
We do have a number of wiki articles dedicated to working with variables.
www.etl-tools.com/wiki/knowledgebase/using_variables?s []=variables
Mike
ETL Architect
Last edit: 4 years 10 months ago by admin.
Please Log in or Create an account to join the conversation.
4 years 10 months ago #18754
by admin
Mike
ETL Architect
Replied by admin on topic Adding Header and Footer Data/Fields for Fixed Width Text File with Text Editor
I have attached actual transformation for your convenience.
Mike
ETL Architect
The following user(s) said Thank You: cchavez
Please Log in or Create an account to join the conversation.
4 years 10 months ago #18765
by cchavez
Replied by cchavez on topic Adding Header and Footer Data/Fields for Fixed Width Text File with Text Editor
We will review and test this afternoon and thank you.
Please Log in or Create an account to join the conversation.
4 years 10 months ago #18802
by cchavez
Replied by cchavez on topic Adding Header and Footer Data/Fields for Fixed Width Text File with Text Editor
Admin this was a great approach we were able to take this and translate it to a series of the steps.
Please Log in or Create an account to join the conversation.