Reputation: 189
Using Talend, I want to verify if there is a file named ListePS.xls
in my D:/
to do some treatment else nothing.
How do I check if file exists in Talend?
Upvotes: 8
Views: 20641
Reputation: 833
Design job like below
tFileExist----If(Exist)-------Use other Components
\
\
If(Not Exist) add other flow
Add below code in first IF condition ((Boolean) globalMap.get ("tFileExist_1_EXISTS"))
and in second IF condition will be !((Boolean) globalMap.get ("tFileExist_1_EXISTS"))
.
Upvotes: 7
Reputation: 111
you must use the component tFileExist with two outputs IF:
((Boolean) globalMap.get ("tFileExist_1_EXISTS")) for the case 1(File existence)
! ((Boolean) globalMap.get ("tFileExist_1_EXISTS")) for case 2 (non-existence of file)
Upvotes: 11
Reputation: 1204
In order to verify that a file exists, you can use the tFileExist component and connect to your conditional treatment with a Run If link.
For parameterization details and usage examples, you can consult the Talend documentation, available in your installation.
In the Talend menubar, select Help > Help contents and then Talend User Documentation > Integration components > tFileExists.
Upvotes: 8