I am looking for a process to delete a bunch of files in a folder by the string name so that only the PDF files that do not fit that naming convention remain. This is the file name PDF Export with bookmarks 2021-12-07 VBI that was created when i split a PDF it adds in a number value. I want to remove all of those but keep the ones with a person name.
Use this syntax
Var_Array_of_String=Directory.GetFiles(“D:\test”)(specific your pdf directory)
pass the varr_Array_of_String in for each
Use if activity to check (“PDF Export”)
like this
item.ToString.Contais(“PDF Export”")
Inside the if activity use delete file and (pass the iterative variable item )
Thats it
Thanks,
Try with the for each file in the folder and condition to check and delete file
Hope this Helps
Regards
Sudharsan
Hi,
Hope the following helps you.
Regards,
Hi,
Can you try to set String at TypeArgument in ForEach activity?
Regards,
I’m sorry I’m not understanding the request? set string at?
Can you show the path which you used
Regards
Sudharsan
Also, Check once whether you have the files inside the folder and those are with correct extension
Regards
Sudharsan
Thank you to everyone who provided guidance, the bot works great and all the tips and tricks I will keep for another time. Happy New Year.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.