pentaho spoon/PDI : how to create a folder with current date?

跟風遠走 提交于 2019-12-11 17:20:55

问题


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 :)


回答1:


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.



来源:https://stackoverflow.com/questions/56423791/pentaho-spoon-pdi-how-to-create-a-folder-with-current-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!