- Launch Talend Studio, and create a local project or import the demo project if you are launching Talend Studio for the first time.
- To create the Job, right-click Job Designs in the Repository tree view and select Create Job.
In the dialog box displaying then, only the first field (Name) is required. Type in California1 and click Finish.
An empty Job then opens on the main window and the Palette of technical components (by default, to the right of the Studio) comes up showing a dozen of component families such as: Databases, Files, Internet, Data Quality and so on, hundreds of components are already available.
- To read the file California_Clients, let's use the tFileInputDelimited component. This component can be found in the group of the Palette. Click this component then click to the left of the design workspace to place it on the design area.
- Let's define now the reading properties for this component: File path, column delimiter, encoding... To do so, let's use the Metadata Manager. This tool offers numerous wizards that will help us to configure parameters and allow us to store these properties for a one-click re-use in all future Jobs we may need.
As our input file is a delimited flat file, let's select File Delimited on the right-click list of the Metadata folder in the Repository tree view. Then select Create
A wizard dedicated to delimited file thus displays:
At Step 1, only the Name field is required: simply type in California_clients and go to the next Step.
At Step 2, select the input file (California_Clients.csv) via the Browse... button. Immediately an extract of the file shows on the Preview, at the bottom of the screen so that you can check its content. Click Next.
At Step 3, we will define the file parameters: file encoding, line and column delimiters... As our input file is pretty standard, most default values are fine. The first line of our file is a header containing column names. To retrieve automatically these names, click Set heading row as column names then click Refresh Preview. And click Next to the last step.
At Step 4, each column of the file is to be set. The wizard includes algorithms which guess types and length of the column based on the file first data rows. The suggested data description (called schema in Talend Studio) can be modified at any time. In this particular scenario, they can be used as is.
There you go, the California_clients metadata is complete!
We can now use it in our input component. Select the tFileInputDelimited you had dropped on the design workspace earlier, and select the Component view at the bottom of the window.
- Select the vertical tab Basic settings. In this tab, you'll find all technical properties required to let the component work. Rather than setting each one of these properties, let's use the Metadata entry we just defined.
Select Repository as Property type in the list. A new field shows: Repository, click "..." button and select the relevant Metadata entry on the list:
You can notice now that all parameters get automatically filled out.
At this stage, we will terminate our flow by simply sending the data read from this input file onto the standard output (StdOut).
- To do so, add a tLogRow component (from the Logs & Errors group). To link both components, right-click the input component and select . Then click the output component: tLogRow.
- This Job is now ready to be executed. To run it, select the Run tab on the bottom panel.
Enable the statistics by selecting the Statistics check box in the Advanced
Settings vertical tab of the Run view, then run the Job by clicking Run in the Basic Run tab.
The content of the input file display thus onto the console.