Skip to main content Skip to complementary content
Close announcements banner

Defining the input component to read the email addresses

Follow the steps below to add and configure the tFileInputDelimited component to the Job script, to read the source file.

Procedure

  1. Create a new Job script, enter an addComponent {} function, and inside this function, enter the setComponentDefinition {} function and its parameters to add the first tFileInputDelimited component:
    addComponent {
    	setComponentDefinition {
    		TYPE: "tFileInputDelimited",
    		NAME: "tFileInputDelimited_1",
    		POSITION: 256, 192
    	}
    
    }
  2. Next to the setComponentDefinition {} function, enter the setSettings {} function to specify the path to the source file, the number of header and footer rows to skip, and optionally the label of the component displayed in the design workspace.

    In this example, the source file is D:/Talend/Data/Input/emails.txt, and the component will be labeled Email addresses

    	setSettings {
    		FILENAME : "\"D:/Talend/Data/Input/emails.txt\"",
    		LABEL : "Email addresses"
    	}
    Information noteWarning:

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

  3. Next to the setSettings {} function, enter in an addSchema {} function and its addColumn {} sub-functions to define the component schema.

    In this example, the source file has only one column, email, type String.

    	addSchema {
    		NAME: "tFileInputDelimited_1",
    		CONNECTOR: "FLOW"
    		addColumn {
    			NAME: "email",
    			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 – let us know how we can improve!