Lets take a simple requirement as mentioned below,
Compute Total Job
We need to read data from a mark sheet file and we need to compute the total of all the marks and it should be added as a new column and stored into a new fileInput File Schema
ID (Number),
MARK1 (Number),
MARK2 (Number),
MARK3 (Number)
Separator: Comma (,)
Header: NoOutput File Schema
ID (Number),
MARK1 (Number),
MARK2 (Number),
MARK3 (Number),
TOTAL (Number)
Separator: Comma (,)
Header: Yes
Now lets start with designing a simple Job for this.
The very first step in designing an ETL job is to identify and define Metadata. Talend provides a variety of wizards for defining metadata. To define the metadata of the input file. Save the “input_marks.csv” attached with this post somewhere in your local PC. Now expand the metadata node in the repository tree and then right click file delimited. In the context menu available select create file delimited.
In the dialog that pops up enter name as “InputMarkSheet_CSV” and time being keep other fields blank and then say next
Now select the browse button and select the file from the path where ever you have saved the attachment and then select next.
Now enter the details as it is appearing in the below image in the next dialog and click refresh button.
Now give your name to your metadata and columns name and then say finish.
Now if you expand the FileDelimeted node in the metadata tree of repository view, then you can see the defined metadata as displayed in the below image.
Now the metadata is ready for our Job. Talend provide very simple and easy way to add the metadata defined objects to the job. For our requirement we need this to be the source element of our job. So to create a job element for this metadata just drag the metadata element and drop it to the design area.
Now Talend fires a question to you asking what you want to create from the metadata and if you scroll down the list then you will be able to find that the tFileInputDelimited is already selected.
Just say ok, Now you can see a component InputFile has got created and it has been defined with all metadata and file properties. This makes our life simpler and now you have the source stage defined for our Job.
You can explore the properties of the components by selecting the components tab in the bottom pane.