How to create a File Positional Metadata Create Schemas on the Repository to describe the Schema of a Positional File.

This tutorial shows how the "Positional File" wizard can help you deal with complex file formats. You can create specific Schemas for all your needs.

For example, you could define a "home adress" schema and another "delivery address" schema both corresponding to the same file.

Prerequisites:
To follow this tutorial, you need to extract and import the customer.txt file from the exampleFile.zip file available for download in the Download it! section of this tutorial.

Download it!

You want to practice?

Download exampleFile.zip to get the files used for this tutorial.

You can also download tutorialProject.zip containing all the jobs needed to carry out this tutorial.

You can also:
Send it!

Share it!
Next Step: Refer to [How to create a File Regex Metadata] tutorial to learn about Regex File Schemas.

 


Create a File positional metadata


In the Repository on the left of the Talend Open Studio main screen:

Expand the Metadata node.

Right-click on File positional.

In the menu, click Create file positional to open the New Positional File wizard.

Next

In the New Positional File wizard:

In the Name field, name the metadata customers.

Click Next to continue.

Next

Click Browse... and select the customer.txt file from the wizard.

From the Format list, select your computer OS.

In the File Viewer area, click between two columns of data to delimit the length of the columns and adjust it by dragging the orange arrow to the very beginning of the next column.

You can also define the length of each column in the Field Separator field.

Click Next.

Next

The schema of the file displays in the Preview area.

As the first line of the file corresponds to the column names, check the Set heading as column names box to retrieve them.

In the Rows To Skip area, check the Footer box and fill in the number of footer rows to ignore: 2, for example.

Click Refresh Preview to take the new parameters into account.

In the Limit of Rows area, check the Limit box and fill in the number of rows to be processed: 4.

Click Refresh Preview.

Click Next.

Next

In the Description of the schema area, a default schema is provided but you can modify it.

Check the Key box for the id column and uncheck the Nullable box for the id, idState and id2 columns.

Click Finish.

Next

In the Repository on the left:

The customers metadata is displayed in the Metadata > File positional node.

  Next Step: Refer to [How to create a File Regex Metadata] tutorial to learn about Regex File Schemas.

 

    Download it!     Send it!     Share it!

You want to practice?

Download exampleFile.zip to get the files used for this tutorial.

You can also download tutorialProject.zip containing all the jobs needed to carry out this tutorial.

Friends / colleagues may be interested in this tutorial? Send it to them!

You liked this tutorial ? Support it!

[ top ]