Delete empty folders

One Star

Delete empty folders

I am currently working on a job to remove files that are older than 6 months old from multiple folders and sub folders. I have got this portion to work correctly.

 

However, I would like to now remove any remaining folders that contain no files. (all of the files were deleted from the first portion of the job and the folder is now empty). I am able to remove the folders however I cannot figure out how to do this based on the content that either remains or does not within the folder, thus they are all deleted no matter what. 

 

Capture.PNG

Fifteen Stars TRF
Fifteen Stars

Re: Delete empty folders

Use tFileList to check if there is at least 1 file or not. Is it what you're looking for?

TRF
One Star

Re: Delete empty folders

That would work I imagine if that is possible? I want to delete any Folder that is empty but make sure I keep folders that contain files (the files that remain should be newer than 6 months from my previous job)

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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads