• 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
  • 相关阅读:
    注意安全 保重身体
    抽象和接口的区别
    哪些设计模式最值得学习
    超级扫盲什么是设计模式?
    简单工厂、工厂方法和抽象工厂模式
    通过领域模型设计物流系统
    json过滤特殊字符
    数据库性能优化JOIN方法说明[转]
    策略模式
    观察者模式
  • 原文地址:https://www.cnblogs.com/huaxiaoyao/p/4158160.html
Copyright © 2020-2023  润新知