tFileInputExcel - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

tFileInputExcel properties

Component family

File/Input

 

Function

tFileInputExcel reads an Excel file (.xls or .xlsx) and extracts data line by line.

Purpose

tFileInputExcel opens a file and reads it row by row to split data up into fields using regular expressions. Then sends fields as defined in the schema to the next component in the Job via a Row link.

Basic settings

Property type

Either Built-in or Repository.

Since version 5.6, both the Built-In mode and the Repository mode are available in any of the Talend solutions.

 

 

Built-in: No property data stored centrally.

 

 

Repository: Select the repository file where the properties are stored. The fields that follow are completed automatically using the data retrieved.

 

Click this icon to open a connection wizard and store the Excel file connection parameters you set in the component Basic settings view.

For more information about setting up and storing file connection parameters, see Talend Studio User Guide.

 

Read excel2007 file format (xlsx)

Select this check box to read the .xlsx file of Excel 2007.

 

File Name/Stream

File name: Name of the file and/or the variable to be processed.

Stream: Data flow to be processed. The data must be added to the flow in order to be collected by tFileInputExcel via the INPUT_STREAM variable in the auto-completion list (Ctrl+Space).

For further information about how to define and use a variable in a Job, see Talend Studio User Guide.

 

All sheets

Select this check box to process all sheets of the Excel file.

 

Sheet list

Click the plus button to add as many lines as needed to the list of the excel sheets to be processed:

Sheet (name or position): enter the name or position of the excel sheet to be processed.

Use Regex: select this check box if you want to use a regular expression to filter the sheets to process.

 

Header

Number of records to be skipped in the beginning of the file.

 

Footer

Number of records to be skipped at the end of the file.

 

Limit

Maximum number of lines to be processed.

 

Affect each sheet(header&footer)

Select this check box if you want to apply the parameters set in the Header and Footer fields to all excel sheets to be processed.

 

Die on error

Select this check box to stop the execution of the Job when an error occurs. Clear the check box to skip the row on error and complete the process for error-free rows. If needed, you can collect the rows on error using a Row > Reject link.

 

First column and Last column

Define the range of the columns to be processed through setting the first and last columns in the First column and Last column fields respectively.

 

Schema and Edit Schema

A schema is a row description, it defines the number of fields to be processed and passed on to the next component. The schema is either Built-in or stored remotely in the Repository.

Since version 5.6, both the Built-In mode and the Repository mode are available in any of the Talend solutions.

This component offers the advantage of the dynamic schema feature. This allows you to retrieve unknown columns from source files or to copy batches of columns from a source without mapping each column individually. For further information about dynamic schemas, see Talend Studio User Guide.

This dynamic schema feature is designed for the purpose of retrieving unknown columns of a table and is recommended to be used for this purpose only; it is not recommended for the use of creating tables.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

 

 

Built-in: The schema will be created and stored locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: The schema already exists and is stored in the Repository, hence can be reused in various projects and Job flowcharts. Related topic: see Talend Studio User Guide.

Advanced settings

Advanced separator

Select this check box to change the used data separators.

 

Trim all columns

Select this check box to remove the leading and trailing whitespaces from all columns. When this check box is cleared, the Check column to trim table is displayed, which lets you select particular columns to trim.

 

Check column to trim

This table is filled automatically with the schema being used. Select the check box(es) corresponding to the column(s) to be trimmed.

 

Convert date column to string

Available when Read excel2007 file format (xlsx) is selected in the Basic settings view.

Select this check box to show the table Check need convert date column. Here you can parse the string columns that contain date values based on the given date pattern.

Column: all the columns availabe in the schema of the source .xlsx file.

Convert: select this check box to choose all the columns for conversion (on the condition that they are all of the string type). You can also select the individual check box next to each column for conversion.

Date pattern: set the date format here.

 

Encoding

Select the encoding from the list or select Custom and define it manually. This field is compulsory for DB data handling.

 

Read real values for numbers

Select this check box to read numbers in real values. This check box becomes unavailable when you select Read excel2007 file format (xlsx) in the Basic settings view.

 

Stop reading on encountering empty rows

Select this check box to ignore the empty line encountered and, if there are any, the lines that follow this empty line. This check box becomes unavailable when you select Read excel2007 file format (xlsx) in the Basic settings view.

 

Generation mode

Available when Read excel2007 file format (xlsx) is selected in the Basic settings view. Select the mode used to read the Excel 2007 file.

  • Less memory consumed for large excel(Event mode): used for large file. This is a memory-saving mode to read the Excel 2007 file as a flow. With this mode selected, the data will be extracted with the format symbol, for example, the percent symbol % and the currency symbol $.

  • Memory-consuming (User mode): used for small file. It needs much memory. With this mode selected, the pure data without the format symbol will be extracted.

 

Don't validate the cells

Select this check box to in order not to validate data. This check box becomes unavailable when you select Read excel2007 file format (xlsx) in the Basic settings view.

 

Ignore the warning

Select this check box to ignore all warnings generated to indicate errors in the Excel file. This check box becomes unavailable when you select Read excel2007 file format (xlsx) in the Basic settings view.

 

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a Job level as well as at each component level.

Global Variables

NB_LINE: the number of rows processed. This is an After variable and it returns an integer.

CURRENT_SHEET: the name of the sheet being processed. This is a Flow variable and it returns a string.

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

Use this component to read an Excel file and to output the data separately depending on the schemas identified in the file. You can use a Row > Reject link to filter the data which doesn't correspond to the type defined. For an example of how to use these two links, see Scenario 2: Extracting correct and erroneous data from an XML field in a delimited file.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

Due to license incompatibility, one or more JARs required to use this component are not provided. You can install the missing JARs for this particular component by clicking the Install button on the Component tab view. You can also find out and add all missing JARs easily on the Modules tab in the Integration perspective of your studio. For details, see https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products or the section describing how to configure the Studio in the Talend Installation Guide.

Related scenarios

No scenario is available for this component yet.