How to delete the specific files from the folder

How to delete the specific files from the folder.

I’m downloading the PDF files from the application within the folder but i want to keep only below files which contains below Name and then want to delete other files.

History and Physical
Progress notes
Discharge summary
Physician order
ED Provider Report
Discharge RPT

Any idea how to do it?

You can loop through the files and use the delete activity to delete what you want

find starter help here:
DeleteFiles_ByNamePart_DT.xaml (11.6 KB)

Configure the datatable with the keywords you want to keep (maybe you want externalize into an excel)
do the other activations (Comment in Comment out, Path settings) and let it run

Let us know your feedback

1 Like


You can follow the demo attached, the only change you have to make is at the end by putting activities to delete the source folder and renaming the destination folder. I hope this demo will suffice your requirements. (6.8 KB)

Hello Vaibhav,
In this video I do a lot of stuff with Files:

1:10 Download the file and Move the latest file to folders
4:30 Rename files with VB commands
6:00 Move files to do Rename
6:55 Delete files
8:15 Delete only PNG files
8:55 Delete all the files except PNG files
9:55 Move files
11:10 Delete files that are older than 2 weeks
Cristian Negulescu

It is very easy to delete any file, use shift + delete key to remove the files. Also, there are many eraser tools available that you can download to wipe any type of file permanently.