count the number of files in a folder

One Star

count the number of files in a folder

Hi,
I would like to count the number of files in a specific folder .

which component do i have to use and which way 


thank you in advance for your help

One Star

Re: count the number of files in a folder

Hi,
You can use tFileList --(Iterate)--> tIterateToFlow --(Main)-->tLogRow.
In tIterateToFlow Mapping, set the value ((Integer)globalMap.get("tFileList_1_NB_FILE")).
Best regards, May T.
One Star

Re: count the number of files in a folder

Sorry my request was incomplete. I don't want to count all the files into a folder but count all the files containing a unique reference.
For example these 9 files:


I was thinking to build a job like that:


But that can't work because of the Iterate .
The value of ((Integer)globalMap.get("tFilterRow_7_NB_LINE_OK")) is 1 and not 9 Smiley Sad
One Star

Re: count the number of files in a folder

Or I was thinking to copy all the files after the tFilterRow in a specific folder, reuse another tFileList and use the variable: tFileList_x_NB_FILE.
But this require a lot of components and maybe there is a simpliest way to achieve this count ?
One Star

Re: count the number of files in a folder

Hi,
Do you have any idea in order to acheive my goal in my previous post plz ?
One Star

Re: count the number of files in a folder

Hi,
You can use a filemask in the tFileList component to filter with a specific pattern.
Did you try this option?
Sunil

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch