Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count of files in a directory

Hi Team

In a directory i am having different files like txt files csv files and text files

is their any component in talend to find the count of files accornding to extension

or what is the procedure we need to follow to achieve the same through talend without using tFilelist component

 

Thanks

Deepthi

Labels (1)
14 Replies
TRF
Champion II
Champion II

All records have been rejected by tFilterRow
sbxr
Contributor III
Contributor III

sir i want the count  of files which is there for more than 30 days in that directory via talend job.

@TRF @shong 

TRF
Champion II
Champion II

After tFilterRow component you can access to 2 global variables which give you the answer:

- ((Integer)globalMap.get("tFilterRow_11_NB_LINE_OK"))

- ((Integer)globalMap.get("tFilterRow_11_NB_LINE_REJECT"))

 

Try to connect a tJava component to tFileList using an OnSubJobOk trigger and print the content of "tFilterRow_11_NB_LINE_OK".

If the result is always 1 but you know it should be greater, add a tSetGlobalVar to replace your tLogRow_2 with the following content:

Key: OldFiles

Value: ((Integer)globalMap.getOrDefault("OldFiles", 0)) + 1

Then in the tJava component you just have added, replace "tFilterRow_11_NB_LINE_OK" by "OldFiles".

 

Let me know.

sbxr
Contributor III
Contributor III

@TRF @xdshi @shong 

not getting the counts , job is returning null,

 

Please design a demo job for this, it will be very helpfull.

 

Thanks

Anonymous
Not applicable
Author

can you upload a screenshot of basic settings of tFilterRow?