[resolved] tFileExist for multiple files

One Star G47
One Star

[resolved] tFileExist for multiple files

Hi,
Is it possible to use only one tFileExist for many files?
For example i want to check 3 files. I must use 3 tFilexist.
Thank's Smiley Happy

Accepted Solutions
Seventeen Stars

Re: [resolved] tFileExist for multiple files

tFileList --Iterate-->tFileExists (use as file name here ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) )
There is no reason because of something fails here. The existence of a file can be checked with the return value EXISTS (check the Outline view) of the tFileExists component. You could extend this the if trigger staring from the tFileExist component and ends up on a component or subjob which is dedicated to the fact of the existence or even not.

All Replies
Seventeen Stars

Re: [resolved] tFileExist for multiple files

No this component works only for one file. If you have to check the existence of multiple files I suggest you use tFileList and set as filter expression your file names and check the returned number of files. 
One Star G47
One Star

Re: [resolved] tFileExist for multiple files

OK, thank's i will try this
Best regards,
G47

Re: [resolved] tFileExist for multiple files

 Thank you Mr.Jlolling. can any one please give me one example to  check existence  of  multiple files with tFileList and tFileExist components, I worked with this But tfilelist is not throwing an error if some files are not available in  the source. how can we keep filter expression. your  advices are appreciated.
Seventeen Stars

Re: [resolved] tFileExist for multiple files

tFileList --Iterate-->tFileExists (use as file name here ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) )
There is no reason because of something fails here. The existence of a file can be checked with the return value EXISTS (check the Outline view) of the tFileExists component. You could extend this the if trigger staring from the tFileExist component and ends up on a component or subjob which is dedicated to the fact of the existence or even not.

Re: [resolved] tFileExist for multiple files

Thank you jlolling. 
i did tFilelist-->tFileExists-->runif(tfileexist.exist)tmsgBox("filefound"), like wise another  -->runif-- tMsgBox("file not fornd ") on (!tFileexist.exist)
but above job showing only file names which  are matching from tFileList->filemasklist names to the folder where we are checking the existence. but  how can we throw the error on file which is in fFilelist filemask but not in the source folder.
ex: I have a FOLDERS called AGENCY it has 13 text files from that files i should take only 7 required files, so i need to check wether the folder has that 7 required file or not. so i am entering those 7 names in tFileList. here if any  required file(among those 7) is not availble in Agency folder then i have to throw the error "so and so file(or)files are missing ".
becoze some times agency folders may not have the required file. i should know which file is missing.
can you please suggest me.
Seventeen Stars

Re: [resolved] tFileExist for multiple files

If you need 7 particular files I suggest you use simply 7 dedicated tFileExists.
You could use a tFileList to iterate over the directories (list directories instead of files) and use the mentioned CURRENT_FILEPATH (which contains now the path to the directory).
I suggest use create a separate job which gets the directory via a context variable and check and process in this job the necessary files with dedicated tFileExists (e.g. 7 of them).