Talend get current filename

南笙酒味 提交于 2019-12-23 04:47:15

问题


I want to load excel files into the mysql database and check that they do not already exist, my problem is that I can not extract the name of the current file.

For example, I have the following files A.xlsx, B.xlsx and C.xls.

It return always B.xlsx


回答1:


I think the issue you have is that your "RunIf" link is before the iterator, and therefore it's not being triggered at the right time.

The image below shows a simplified version, where I list the rows in the spreadsheets and then the file names. If I connected the second subjob to the tFileList_1 component, as you did in the question, I only get the logs from tLogRow_1 and the last filename by tLogRow_2.

With the link as shown, behind the iterator, then I get spreadsheet contents listed and then the title of it:

Col1|Col2|Col3
A|B|C
D|E|F
A.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
B.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
C.xlsx

I am assuming that you have filted out the duplicated files in the tMap component, so if you link your second subjob from the disponsibilite_3d component, I think you will get the result you are looking for.



来源:https://stackoverflow.com/questions/53383836/talend-get-current-filename

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