Hello ,
I need to check if there is any xlsx files present in folder and delete it.
How can I achieve it?
Hello ,
I need to check if there is any xlsx files present in folder and delete it.
How can I achieve it?
Hi @Karan28
StrArray=Directory.GetFiles(“your file path”,“xlsx”)
use for each item in strarray
Use Path exists
then use delete file
Thanks
Ashwin S
HII
hope these steps would help you resolve this
–use assign activity and mention like this
arr_filepath = Directory.GetFiles(“yourfolderpath”,“*.xlsx”)
where arr_filpath is a variable of type array of string
—and pass this variable to arr_filepath to a FOR EACH activity where change the type argument as string in the property panel of for each loop
–inside the loop use DELETE activity and mention the input as item.tostring
Cheers @Karan28
Try below expression to find excel files.
excelFiles [] = Directory.GetFiles("Folder path","*.xlsx")
IF excelFiles.Count > 0
Then use ForEach loop to iterate files and inside that use Delete activity to delete file
hey lakshman , yes your solution worked just like @Palaniyappan
thankyou so much
I dont know whose comment I should mar as solution hehe
You guys decide!
Glad to help you and happy that our solution got worked. You can mark any one solution and that is not a problem. Infact he gave reply first and you can mark his post as solution.
Thankyou Laksham , All the best
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.