pentaho 勺子/PDI:如何创建具有当前日期的文件夹? [英] pentaho spoon/PDI : how to create a folder with current date?

查看:61
本文介绍了pentaho 勺子/PDI:如何创建具有当前日期的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,我想知道如何创建一个具有当前日期(dd/mm/yyyy)(在工作中)的文件夹.我看过两个答案,但它们看起来很长,例如这个:

你的工作是这样的

另外请注意,您不能使用/"创建文件夹,因此您必须使用其他模式.

这是一种非常简单的方法,还有其他方法可以通过使用变量来自动创建文件夹.

更正了 JOB 图像,需要实际运行第一个 KTR 才能设置变量,抱歉造成混淆.

As the title says, I'd like to know how to create a folder with current date(dd/mm/yyyy) (on Job). I've seen two answers but they seemed quite long, for example this one: pentaho create archive folder with MM-YYYY

Anyone has an idea? Thanks :)

解决方案

That answer is also from 2014, better and newer versions of PDI are out, and this answer is overcomplicating the task.

Though you do need to create the folder name in a KTR, you can just use the 'Create folder' Job step. I'm pretty sure you cannot set AND use a variable in the same JOB/KTR that you have set it to begin with. So you need a KTR that generates a Date and sends it as string to a JOB.

Your KTR should like this, to create a String date with the format YYYY-MM-DD

And your Job like this

Also remenber, you can't create folders with '/', so you have to use another pattern.

This is a very simplistic approach, there are other ways to automate folder creation through use of variables.

EDIT: Corrected the JOB image, the first KTR needs to actually run for the variable to be set, sorry for the confusion.

这篇关于pentaho 勺子/PDI:如何创建具有当前日期的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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