Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
dilip_n
Contributor II
Contributor II

How to print total files size in folder

hi there, I have a query,

my folder contains 100 files with the same metadata in text format.

so I need in the output the total number of files and the sum of (the total size of files), i used the below job, but I got the solution for the total number of files and I didn't know how to print total files size. if anyone knows plz help me. thank you in advance

0695b00000fHlZGAA0.png

0695b00000fHlYcAAK.png

Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

There is a global variable ((Integer)globalMap.get("tFileList_1_NB_FILE")) that counts the total number of files are found, you can use this global variable.

To get the total size of all files, you need to calculate the sum using tAggregateRow as you did.

tHashInput--main---tMap--tAggregateRow--tFileOutputDelimited

 

on tMap, add a new column in the output table and set a fixed value (eg: "groupName"), this column will be used as group element on tAggreGateRow to sum up the file sizes.

 

Regards

Shong

 

View solution in original post

3 Replies
dilip_n
Contributor II
Contributor II
Author

i think this one is correct might be, see attached

 

0695b00000fHmT9AAK.png

Anonymous
Not applicable

Hi

There is a global variable ((Integer)globalMap.get("tFileList_1_NB_FILE")) that counts the total number of files are found, you can use this global variable.

To get the total size of all files, you need to calculate the sum using tAggregateRow as you did.

tHashInput--main---tMap--tAggregateRow--tFileOutputDelimited

 

on tMap, add a new column in the output table and set a fixed value (eg: "groupName"), this column will be used as group element on tAggreGateRow to sum up the file sizes.

 

Regards

Shong

 

dilip_n
Contributor II
Contributor II
Author

Thank you bro, now i got the solution.