Need help for how can use wildcard charecter if i want to unzip file

APN wise Sub
this my file name and i want to unzip but the issue now there export time in file name how can use wildcard to exclude this from name or how can i change the name when i save the attachment from email
i try to used * like snap but it give me error
please need support

Make sure that the file exists in the given directory.

Please get the full file path into a variable like below.

strFile = ,"APN wise Sub @BH_" + DateTime.Now.AddDays(-1).ToString("yyyyMMdd")
strFileName = DirectoryInfo.GetFiles(directorypath, strFile + "*.zip")(0).FullName.ToString

Enter strFileName in the ZipFile activity.

Note - If you think the file doesn’t exists sometimes, you need to change the code a bit, use GetFiles, get the count and take the file only if count is greater than 0.

Karthik Byggari

thanks dear but it’s i didn’t get your point and also i try and give me error could you help me please

Please create and assign the variable - directorypath

still the same issue dear

What is the error message?

Just use like this - DirectoryInfo.GetFiles(directorypath, strFile + "*.zip")(0).ToString

still dear not working

there is no solutiob to only like remove or escape the time ( 07 ) from the name because of that i have issue because the email will send at 7 but if i want to run the task at 8 then i can’t unzip file that if i put hh to name file in unzip activity
APN wise Sub

Instead of that, you can rename the file.
So you can use it at anytime.

strFileName = "APN wise Sub"
strNewFileName = strFileName.SubString(0, strFileName.Length - 6) + ".zip"


what variable type should be

Try this -

Assign Activity, string[] files = DirectoryInfo.GetFiles(dirPath,"*APN wise Sub @BH_*.zip")

If Activity

    if files.Length > 0
      **Assign Activity**, filename = files(0).ToString
    End if

Just use the filename in the zipFile path

Please try the one which I posted in the previous post.
Else I will send you the sample workflow by today.

ok dear