【问题标题】:How can I use tFileExist component in Talend?如何在 Talend 中使用 tFileExist 组件?
【发布时间】:2023-03-06 00:51:01
【问题描述】:

使用 Talend,我想验证我的 D:/ 中是否有一个名为 ListePS.xls 的文件 做一些治疗别的什么都没有。

如何检查 Talend 中是否存在文件?

【问题讨论】:

    标签: talend


    【解决方案1】:

    您必须使用具有两个输出的组件 tFileExist

     ((Boolean) globalMap.get ("tFileExist_1_EXISTS")) for the case 1(File existence)
     ! ((Boolean) globalMap.get ("tFileExist_1_EXISTS")) for case 2 (non-existence of file)
    

    【讨论】:

      【解决方案2】:

      为了验证文件是否存在,您可以使用 tFileExist 组件并通过 Run If 链接连接到您的条件处理。
      有关参数化详细信息和使用示例,您可以查阅安装中提供的 Talend 文档。 在 Talend 菜单栏中,选择 帮助 > 帮助内容,然后选择 Talend 用户文档 > 集成组件 > tFileExists

      【讨论】:

        【解决方案3】:

        如下设计工作

        tFileExist----If(Exist)-------Use other Components 
                \
                 \
                  If(Not Exist) add other flow
        

        在第一个 IF 条件 ((Boolean) globalMap.get ("tFileExist_1_EXISTS")) 中添加以下代码,在第二个 IF 条件中添加 !((Boolean) globalMap.get ("tFileExist_1_EXISTS"))

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-06-15
          • 1970-01-01
          • 2016-03-22
          • 1970-01-01
          • 1970-01-01
          • 2020-12-15
          相关资源
          最近更新 更多