August 15, 2023

Listing all files/folders on the FTP root directory – Docs for ESB 6.x

Listing all files/folders on the FTP root directory

Configure the tFTPFileList
component, the tIterateToFlow component, and the
tLogRow component to iterate all files and folders on
the FTP root directory and display the names and paths of these files and folders on the
console of
Talend Studio
.

  1. Double-click the tFTPFileList
    component to open its Basic settings view.

    use_case_tftpfilelist3.png

  2. Specify the connection details required to access the FTP server. In
    this example, select the Use an existing connection
    check box and from the Component list drop-down
    list displayed, select the connection component to reuse its connection details you
    have already defined.
  3. In the Remote directory field, specify
    the FTP server directory on which the files and folders will be iterated. In this
    example, it is /, which means the root directory
    of the FTP server.
  4. Clear the Move to the current
    directory
    check box.
  5. Double-click the tIterateToFlow
    component to open its Basic settings view.

    ftp_job_list_files_titeratetoflow_basic.png

  6. Click the

    components-button_three_dot.png

    button next to Edit schema to
    open the schema dialog box.

    ftp_job_list_files_titeratetoflow_schema.png

  7. Click the

    plus_button.png

    button to add two String type columns
    filename and filepath
    that will hold the names and paths of the files to be iterated respectively. When
    done, click OK to close the dialog box.

  8. In the Mapping table, set the values
    for the filename and filepath columns. In this example, the global variable ((String)globalMap.get(“tFTPFileList_1_CURRENT_FILE”))
    for filename and the global variable ((String)globalMap.get(“tFTPFileList_1_CURRENT_FILEPATH”)) for
    filepath.

    Note that you can fill the values by pressing Ctrl + Space to access the global variables list and then selecting
    tFTPFileList_1_CURRENT_FILE and
    tFTPFileList_1_CURRENT_FILEPATH from the list.

  9. Double-click the tLogRow component to
    open its Basic settings view, and then select
    Table (print values in cells of a table) in the
    Mode area for better readability of the
    result.

    tlogrow_table_mode.png


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