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

excel
activities
studio

#1

APN wise Sub @BH_20190201107.zip
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


#2

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.

Regards,
Karthik Byggari


#3


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


#4

Please create and assign the variable - directorypath


#5

still the same issue dear


#6

What is the error message?


#7


#8

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


#9

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 @BH_20190201107.zip


#10

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

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

#11

dear

what variable type should be


#12

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


#13


#14

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


#15

ok dear
thanks