zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    Action/Service/DAO简介 一
    Python中的Nonetype类型怎么判断?
    idea 中使用maven命令
    python-字符串中含有变量的表示方法
    python-configparser模块,读取配置文件
    python json 和 dict
    python interpreter解释器设置
    python写入数据到excel-xlwt模块(不能修改,每次写入全覆盖)
    pymongo问题集合
    excel表操作使用记录
  • 原文地址:https://www.cnblogs.com/huaxiaoyao/p/4158160.html
Copyright © 2011-2022 走看看