Read Multi Schema Delimited File using tFileInputMSDelimited

Read Multi Schema Delimited File using tFileInputMSDelimited
5 (100%) 6 votes

tFileInutMSDelimited

component use for reading multi schema delimited files, this post I demonstrate how to parse, MS delimited files and use configure tFileInputMSDelimited component.

here is our sample input data which has header records then its trailer records.

Invoice Header record start with “H” alphabet and Invoice Detail/trailer record start with “T” Alphabet.

Sample header-trailer records
Sample header-trailer records

we will use tFileInutMSDelimited component to parse these records. so create a job and drag and drop tFileInutMSDelimited component and then double click on it, it will show you another screen for metadata creation.

select our source file, then select column separator & row separator, once that is done then flow the below steps.

  • In preview window select first column which has “H” and “T” values.
  • In Schema grid click on add button and provide following values.
    • Schema=H
    • Record=H
    • Separator=;
  • Click on “OK” you will one record created with provided values.
  • Click on fetch Codes button, it fetch all the visible codes from mention file and creates schema based on column delimiter.
  • Our configuration looks like below image.
tFileInputMSDelimited configuration
tFileInputMSDelimited configuration
  • Now go to the component setting tab and click on first schema which may look like row_A_1 click on it.
  • it will show you schema with default column names.
  • modify column name as follows.
Header Schema details
Header Schema details
  • We are done with Header schema now do the same thing with Trailer schema and modify column names.
Trailer Schema details
Trailer Schema details
  • Add tLogRow and connect to the tFileInputMSDelimited component using “row_A_1″ schema.
  • Do the Same thing for “row_B_1″ schema.
  • Now Execute the job your output will be like this.
Header-Trailer Output
Header-Trailer Output

you can achieve same thing using other ways, but trust me this is the most simple way.

 

About Umesh

I am Software consultant with approx 7 years of experience mainly in Business Intelligence and data warehousing assignments using Talend. Writing is not my passion but i am doing it to help others. if you have any special case where you want me to demonstrate then please post me.

Leave a Reply

Your email address will not be published. Required fields are marked *