Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Deleting older files

adarsh2608
8 - Asteroid

Hello,

 

Every time when I run the workflow new files are generated . i want alteryx to check the directory and if the number of files is more than or equal to 10 then it should delete last 5 files 

5 REPLIES 5
Felipe_Ribeir0
16 - Nebula

Hi @adarsh2608 

 

Take a look at this solution, you can adapt it to your use case.

Deleting Files Using Batch Files - Alteryx Community

adarsh2608
8 - Asteroid

I have tried that , but there is restriction in running command , is there any other alternative way to delete files 

Felipe_Ribeir0
16 - Nebula

Hi @adarsh2608 , there is this other way, the files can be deleted using the python component. Please test this macro, i built it to do this task.

 

Delete Files - Alteryx Community

 

Basically you need to pass the filepaths to the macro and it will handle the task.                                                                                                                                                                                                                          

Felipe_Ribeir0_0-1663957727877.png

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

adarsh2608
8 - Asteroid

Hello @Felipe_Ribeir0 ,

 

Thanks for the reply ,.

adarsh2608
8 - Asteroid

Hello @Felipe_Ribeir0 ,

 

Thanks for the reply , it worked 

Labels