Skip to main content Skip to complementary content

Defining the output component

Follow the steps below to add and define the output component in this example, tFileOutputDelimited.

Procedure

  1. Next to the tMap component definition, enter another addComponent {} function, and inside this function enter the setComponentDefinition {} function and its minimal required parameters to add the output component.
    addComponent {
    	setComponentDefinition {
    		TYPE: "tFileOutputDelimited",
    		NAME: "tFileOutputDelimited_1",
    		POSITION: 736, 256
    	}
    }
  2. Next to the setComponentDefinition {} function, enter the setSettings {} function and parameters required to define the component properties:
    • The path to the output file

    • Whether to include the header in the output file

    • The encoding type of the output file

    • Whether to throw an error and stop Job execution if the specified output file already exists

    • The label of the component displayed in the generated Job on the design workspace

    	setSettings {
    		FILENAME : "\"E:/Talend/data/output/consolidated_list.csv\"",
    		INCLUDEHEADER : "true",
    		ENCODING : "\"UTF-8\"",
    		ENCODING:ENCODING_TYPE : "UTF-8",
    		FILE_EXIST_EXCEPTION : "false",
    		LABEL : "consolidated_list"
    	}
    Information noteWarning:

    Be sure to use a backslash (\) when specifying a metacharacter.

  3. Next to the setSettings {} function, enter an addSchema {} function to define the schema of the output component.

    Note that the column definitions of this schema must be the same as those of the output schema defined in the preceding component, tMap.

    addSchema {
    		NAME: "tFileOutputDelimited_1",
    		CONNECTOR: "FLOW",
    		LABEL: "out"
    		addColumn {
    			NAME: "id",
    			TYPE: "id_Integer",
    			LENGTH: 2
    		}
    		addColumn {
    			NAME: "full_name",
    			TYPE: "id_String"
    		}
    		addColumn {
    			NAME: "age",
    			TYPE: "id_Integer",
    			LENGTH: 2
    		}
    		addColumn {
    			NAME: "city",
    			TYPE: "id_String"
    		}
    	}

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!