July 30, 2023

tFileInputARFF – Docs for ESB 7.x

tFileInputARFF

Reads an ARFF file row by row to split them up into fields and then sends the fields
as defined in the schema to the next component.

tFileInputARFF Standard properties

These properties are used to configure tFileInputARFF running in the Standard Job
framework.

The Standard
tFileInputARFF component belongs to the File family.

The component in this framework is available in all Talend
products
.

Basic settings

Property type

Either Built-in or Repository.

 

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.

tFileInputARFF_1.png

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

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

File Name

Name and path of the ARFF file and/or variable
to be processed.

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

User Guide.

Warning: Use absolute path (instead of relative path) for
this field to avoid possible errors.

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.

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

Encoding

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

tStatCatcher Statistics

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

Global Variables

Global Variables

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

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

Usage rule

Use this component to read a file and separate
the fields with the specified separator.

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. You can find more details about how to install external modules in
Talend Help Center (https://help.talend.com)
.

Displaying the content of a ARFF file

This scenario describes a two-component Job in which the rows of an ARFF file
are read, the delimited data is selected and the output is displayed in the Run view.

An ARFF file looks like the following:

tFileInputARFF_2.png

It is generally made of two parts. The first part describes the data
structure, that is to say the rows which begin by @attribute and the second part comprises the raw data, which follows the
expression @data.

tFileInputARFF_3.png

Dropping and linking components

  1. Drop the tFileInputARFF component from
    the Palette onto the workspace.
  2. In the same way, drop the tLogRow
    component.
  3. Right-click the tFileInputARFF and select
    Row > Main in the menu. Then, drag
    the link to the tLogRow, and click it. The
    link is created and appears.

Configuring the components

  1. Double-click the tFileInputARFF.
  2. In the Component view, in the File Name field, browse your directory in order
    to select your .arff file.
  3. In the Schema field, select Built-In.
  4. Click the […] button next to Edit schema to add column descriptions
    corresponding to the file to be read.
  5. Click on the

    tFileInputARFF_4.png

    button as many times as required to create the number
    of columns required, according to the source file. Name the columns as
    follows.

    tFileInputARFF_5.png

  6. For every column, the Nullable check box
    is selected by default. Leave the check boxes selected, for all of the
    columns.
  7. Click OK.
  8. In the workspace, double-click the tLogRow
    to display its Component view.

    tFileInputARFF_6.png

  9. Click the […] button next to Edit schema to check that the schema has been
    propagated. If not, click the Sync columns
    button.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.
  2. Press F6 to execute your Job.

    tFileInputARFF_7.png

    The console displays the data contained in the ARFF file, delimited using
    a vertical line (the default separator).

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x