• Load xlsx in a folder to RDBMS table with Talend


       

    Step 1 . Use tFileList component to get the file list. And set proper property.

    Step 2. Use tFileInputExcel to Read Xlsx File. For this, I build a Excel in metadata,

    This can help us build the schema for Excel.

    Set the excel file property : ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

    Step 3. I need add one additional field in the table. This field's value from the file path.

    So I add one tMap component,

    Use one expression to get the value.

       

    Step 4.add one tOracleOutput compoment,

       

    You can specify a tableName, and specify the Action on Table, help you create the table.

    Now this place , you should take care of one thing, the schema get from upstream,

    So you maybe need change the column size for the database table.

       

    If we want to use parameter to replace the fixed value for the excel folder, what we should do ?
    first , we should build a context in contexts.

    Add one variable and set the default value .

    Then in the job we create, in the context view, choose that context and variable.

       

    Then choose the component tfilelist1 and change the property Directory:context.ExcelFolder(your variable name).

       

    When you build the talend to jar, the main entry is the current active job. Pay attention to this.

    And it will generate the shell file, context will converted to property file.

       

    In the left panel, in Job Designs, right click, choose build job.

    Looking for a job working at Home about MSBI
  • 相关阅读:
    GTD时间管理(1)---捕获搜集
    ios面试总结-
    Swift入门篇-结构体
    Swift入门篇-闭包和函数
    swift入门篇-函数
    Swift入门篇-集合
    Swift入门篇-循环语句
    Swift入门篇-基本类型(3)
    Swift入门篇-基本类型(2)
    Swift入门篇-基本类型(1)
  • 原文地址:https://www.cnblogs.com/huaxiaoyao/p/4158160.html
Copyright © 2020-2023  润新知