文件名如果Pentaho Kettle

时间:2015-11-30 10:05:35

标签: rename pentaho move exists kettle

美好的一天,

在Kettle Pentaho中,如果使用Move files...,那么我们可以在目的地中编辑文件名,例如指定日期时间格式,因此像abc.txt这样的文件将变为abc02012015.txt目的地。

但是,如果目标文件存在,我们有一些替代方法来处理它,即:can refer to pentaho website

Do nothing
Overwrite destination file
Create file with unique name
Delete source file
Move source file to folder : use the lower part of the dialog (next option in this grid)
Fail

我选择Create file with unique nameMove source file to folder,但我无法控制文件名,它只会追加到txt后面,例如,如果abc02012015.txt已经存在,那么下一个文件将是abc02012015.txt20120115_164553abc02012015.txt164553

我希望我可以控制文件名变成abc02012015_01.txtabc02012015_02.txt,就像那样。

我可以知道有什么办法吗?或者这是Pentaho Kettle的限制?

1 个答案:

答案 0 :(得分:2)

您是正确的,不能使用Move files...指定格式。但是,可以创建一个满足您需求的作业。你必须手动完成它。使用File Exists手动检查文件是否存在并进行手动重命名,或者执行JavaJavaScript步骤以查找所需的文件名。