问题
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