Pentaho Kettle-动态获取文件名 [英] Pentaho Kettle - Get the file names dynamically

查看:1865
本文介绍了Pentaho Kettle-动态获取文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望此消息对大家都有益!

I hope this message finds everyone well!

我在Pentaho PDI Tool上遇到了问题,我正在寻找答案(或者至少在山洞尽头有一个灯)来解决问题!

I'm stucked on a situation on Pentaho PDI Tool and I'm looking for an answer (or at least a light in the end of the cave) to solve it!

我每个月都必须导入一堆xls的,不同客户的文件.每个文件都有一个不同的名称(女巫的名字是偶然的),并且这些文件位于以客户端名称命名的文件夹中.但是,我对所有客户和情况都使用相同的过程.

I have to import, every month, a bunch of xls's files of differents clients. Every file has a different name (witch is given aleatory) and this files are on a folder named with the name of the client. However, I use the same process for all clients and situations.

是否有一种方法可以将目录名称作为变量传递,并在每个进程中更改此变量?如何在不同的路径上读取此文件?

Is there a way to pass the name of the directory as a variable and change this variable on every process? How can I read this files on differents paths?

推荐答案

您要查找的答案需要一个如您所述的带有变量的流程.在作业中,您将从带有客户名称及其各自文件夹的KTR开始.在同一个JOB中,您将传递这些结果并将其用作变量,如果需要的话,传递给另一个JOB,或者传递给KTR,并且您将使用选项将先前的结果复制到参数"和对每个输入行执行" (高级选项卡),然后在参数选项卡中将命名变量和流列名称(数据来自上一个KTR中的位置,即:客户端名称和目录).

The answer you're looking for requires a flow with variables as you stated. In a JOB you will start with a KTR with the client's name and their respective folder. In the same JOB you are going to pass these results and use them as variables, to another JOB if needed, or to a KTR, and you are going to use the options "Copy previous results to parameters" and "Execute for every input row" (Advanced Tab), and in the parameters tab you will name the variables and stream column name (where the data is coming from in the previous KTR, ie.: Clients name and directory).

如果您在创建此流程时遇到麻烦,我可以节省更多时间,并在需要时共享示例.

If you have trouble with creating this flow i can spare some more time and share a sample if you need.

这里的示例

这篇关于Pentaho Kettle-动态获取文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆