Component folder

One Star

Component folder

Good morning.

Is there any component that counts the number of files that are in a folder?

I need to be stored in a variable, the number of records that exist in a folder and not how.

Thank you very much.

Moderator

Re: Component folder

Hi,

Please take a look at a component TalendHelpCenter:tFileList which iterates on files or folders of a set directory.
You can use the global variableSmiley Sad(Integer)globalMap.get("tFileList_2_NB_FILE")). It counts the number of files found.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Component folder

xdshi wrote:

Good Morning,

First, thank you very much for your reply.

I stored in a global variable in a tJava this: context.numeroImagenes = ((Integer) globalMap.get ("tFileList_1_NB_FILE"));

The problem is that stored me: (1,2,3,4) and I just need the last value.

You can store only the last value?

thank you!
Good Morning,

First, thank you very much for your reply.

I stored in a global variable in a tJava this: context.numeroImagenes = ((Integer) globalMap.get ("tFileList_1_NB_FILE"));

The problem is that stored me: (1,2,3,4) and I just need the last value.

You can store only the last value?

thank you!
Hi,

Please take a look at a component TalendHelpCenter:tFileList which iterates on files or folders of a set directory.
You can use the global variableSmiley Sad(Integer)globalMap.get("tFileList_2_NB_FILE")). It counts the number of files found.

Best regards
Sabrina

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 2

Part 2 of a series on Context Variables

Blog

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