Component family |
File/Management |
|
Function |
tCreateTemporaryFile creates and |
|
Purpose |
tCreateTemporaryFile helps to |
|
Basic settings |
Remove file when execution is over |
Select this check box to delete the temporary file after Job |
|
Use default temporary system directory |
Select this check box to create the file in the system’s default |
|
Directory |
Select this check box to create the temporary file . |
|
Template |
Enter a name to the temporary file respecting the template. |
|
Suffix |
Enter the filename extension to indicate the file format you want |
Usage |
tCreateTemporaryFile provides the |
|
Global Variables |
FILEPATH: the path where the file was created. This is an ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
Connections |
Outgoing links (from this component to another):
Trigger: On Subjob Ok; On Subjob Incoming links (from one component to this one): Row: Iterate.
Trigger: Run if; On Subjob Ok; On For further information regarding connections, see |
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User 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 |
n/a |
The following scenario describes a simple Job that creates an empty temporary file in
a defined directory, writes data in it and deletes it after Job execution.
Dropping and linking components
-
Drop the following components from the Palette onto the design workspace: tCreate
temporaryFile, tRowGenerator,
tFileOutputDelimited, tFileInputDelimited and tLogRow. -
Connect tCreateTemporaryFile to tRowGenerator using a SubjobOk link.
-
Connect tRowGenerator to tFileOutputDelimited using a Row Main link.
-
Connect tRowGenerator to tFileInputDelimited using a SubjobOk link.
-
Connect tFileInputDelimited to tLogRow using a Row
Main link.
Configuring the components
-
In the design workspace, select tCreateTemporaryFile.
-
Click the Component tab to define the basic
settings for tCreateTemporaryFile. -
Select the Remove file when execution is over
check box to delete the created temporary file when Job execution is
over. -
Click the three-dot button next to the Directory field to browse to the directory where temporary files
will be stored, or enter the path manually. -
In the Template field, enter a name for the
temporary file respecting the template format. -
In the Suffix field, enter a filename
extension to indicate the file format you want to give to the temporary
file. -
In the design workspace, select tRowGenerator
and click the Component tab to define its basic
settings. -
Set the Schema to Built-In.
-
Click the Edit schema three-dot button to
define the data to pass on to the tFileOutputDelimited component, one column in this scenario,
value.Click OK to close the dialog box.
-
Click the RowGenerator Editor three-dot
button to open the editor dialog box. -
In the Number of Rows for Rowgenerator field,
enter 5 to generate five rows and click
Ok to close the dialog box. -
In the design workspace, select tFileOutputDelimited and click the Component tab to define its basic settings.
-
Set Property Type to Built-In.
-
Click in the File Name field and use the
Ctrl+Space bar combination to access the
variable completion list. To output data in the created temporary file, select
tCreateTemporaryFile_1.FILEPATH
on the global variable
list. -
Set the row and field separators in their corresponding fields as
needed. -
Set Schema to Built-In and click Sync columns
to synchronize input and output columns. Note that the row connection feeds
automatically the output schema.For more information about schema types, see Talend Studio
User Guide. -
In the design workspace, select the tFileInputDelimited component.
-
Click the Component tab to define the basic
settings of tFileInputDelimited. -
Click in the File Name field and use the
Ctrl+Space bar combination to access the
variable completion list. To read data in the created temporary file, select
tCreateTemporaryFile_1.FILEPATH
on the global variable
list. -
Set the row and field separators in their corresponding fields as
needed. -
Set Schema to Built in
and click Edit schema to define the
data to pass on to the tLogRow component. The
schema consists of one column here, value.
Saving and executing the Job
-
Press Ctrl+S to save the Job.
-
Press F6 to execute the Job or click the
Run button of the Run tab.
The temporary file is created in the defined directory during Job execution and the
five generated rows are written in it. The temporary file is deleted when Job execution
is over.