pentaho 勺子/pid:如何每次将文件移动到不同名称的文件夹? [英] pentaho spoon/pid: how to move files to folders with different name everytime?

查看:50
本文介绍了pentaho 勺子/pid:如何每次将文件移动到不同名称的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每个月都有新的文本文件,从中提取数据并进行一些转换.在每个月底,我需要将这些文件移动到名称为当前日期的文件夹中.这意味着,目标文件夹的名称每次都不同.我在 move files 之前做了一个步骤,它创建了一个文件夹,它的名字是当前日期(exp:2019-06-01, 2019-07-01),然后在 move files代码>步骤,我不知道如何指定目标文件夹.猜测通配符"仅用于源...

I have new text files every month from where I extract the data and do some transformations. In the end of every month, I need to move these files to a folder with current date in name. Which means, the destination folder's name is different everytime. I made a step before move files that creates a folder and its name is current date (exp: 2019-06-01, 2019-07-01), but then on move files step, I don't know how to specify the destination folder. Guess "wildcard" is only used for source...

否则,在 move files - Destination file - Move to folder 上,有 create folder 选项,认为这可能是一个解决方案,但如截图所示,本节不能修改.是什么原因?

Otherwise, on move files - Destination file - Move to folder, there is create folder option, thought it could be a solution but as on the screenshot, this section can't be modified. What is the reason?

有人有想法吗?感谢阅读:))

Does anyone have an idea ? Thanks for reading :))

推荐答案

您可以利用 这个这个任务的方法.

You can utilize this approach for this task.

基本上,您必须在进行转换之前从每个文件中提取您想要的日期,并且在完成所有转换之后,您将使用 JOB 步骤移动文件",但不是传递固定的目的地,您将在路径中使用变量,就像这样 answer,但您之前不需要创建文件夹,您可以使用移动文件"步骤中的选项,因此文件夹是在运行时创建的.

Basically you'll have to extract the date you want from each file before doing the transformations, and after all the transformations are done, you'll use the JOB step 'Move files', but instead of passing a fixed destination, you'll use variables in the path, much like this answer, but you don't need to create the folder before, you can just use the option on the 'Move files' step, so the folders are created at run time.

我在 KTR/KJB 中附上了这种方法的示例以及一些评论.您可以在此处

I have attached an example of this approach with some commentary in the KTR/KJB. You can download here

让我知道链接是否有效,这是我第一次在 StackOverflow 中发布外部文件

Let me know if the link is working, this is my first time posting an external file in StackOverflow

这篇关于pentaho 勺子/pid:如何每次将文件移动到不同名称的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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