count the number of files in a folder

Highlighted
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

Highlighted
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.
Highlighted
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
Highlighted
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 ?
Highlighted
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 ?
Highlighted
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 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog