cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete multi files with dynamic names

sdeng
New Contributor II

We want to delete all the files begin with the same name like samplefile_*.csv. But we don’t know how many files or exact file names in advance, is there a way to achieve this?
Get the file names from the specific folder and then delete all of them?

1 ACCEPTED SOLUTION

nsingam
Employee
Employee

Hi Susan,

 You can use the Directory Browser snap to filter the required files then use the file delete snap.

 Ex: In Directory Browser snap for the field Directory give the full path of the directory and for the field File filter use the value as samplefile_*.csv. With this step, you will get all the files which satisfy the condition. Then you can $Path to delete these files using file delete snap.

View solution in original post

1 REPLY 1

nsingam
Employee
Employee

Hi Susan,

 You can use the Directory Browser snap to filter the required files then use the file delete snap.

 Ex: In Directory Browser snap for the field Directory give the full path of the directory and for the field File filter use the value as samplefile_*.csv. With this step, you will get all the files which satisfy the condition. Then you can $Path to delete these files using file delete snap.