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

This tutorial shows you how the "Regex 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 address" schema and another "delivery address" schema both corresponding to the same file.

Prerequisites:
To follow this tutorial, you need to extract and import the regex.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 Input and Output Xml File Metadata] tutorial to discover how to create XML files Schemas.

 


Create a File regex metadata


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

Expand the Metadata node.

Right-click on File regex.

In the menu, click Create file regex to open the New RegEx File wizard.

Next

In the New RegEx File wizard:

In the Name field, name the metadata regex.

Click Next to continue.

Next

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

From the Format list, select your computer OS.

Click Next.
Next

In the Regular Expression settings area, set the regular expression based on the regex file schema: "^firstname=(.+?)lastname=(.+?)age=(\\d+)$".

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

Click Refresh Preview to take the new parameters into account.

Click Next.

Next

In the Description of the Schema area, modify the default schema.

Check the Key case next to column0.

Select column2 and click [x] to delete the column.

Click Finish.

Next

In the Repository on the left:

The regex metadata is displayed in the Metadata > File regex node.

  Next Step: Refer to [How to create Input and Output Xml File Metadata] tutorial to discover how to create XML files 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 ]