Extracting the zip file

Hi all,
I need to unzip the zip file on daily basis, while unzipping need to enter the password
“which will be in the format “Fis_MMMyy” in lower case.
The input file will be day-1 file i.e today we need to do automate yesterdays process.
if today is dec 1st then I need to do automate for 30th nov input files.
Till yesterday the process was working fine but today it is giving the error password is incorrect this is because instead of typing “Fis_nov21” it is typing “Fis_dec21”
on every month 1st I need to enter previous month password.
for ex today is Dec 1st, so I need to enter Fis_nov21 as a password, from dec 2nd I need to enter “Fis_dec21” till 1st of jan 2022 and so on.
Someone please do needful.
My logic=” “Fis_”+date.Now.ToString(“MMM”).ToLower+date.now.ToString(“yy”)"

@Yoichi
@Palaniyappan
@Sudharsan_Ka
@rahulsharma
@geetishree.rao
@lakshman
@ppr

Hi,

Use like this below it will give today Fis_nov21 and tomorrow it will enter Fis_dec21 month.

“Fis_”+now.AddDays(-1).ToString(“MMM”)+now.AddDays(-1).ToString(“yy")

1 Like

Hi!

“FIS_”+now.AddDays(-1).ToString(“MMM”).ToLower+now.AddDays(-1).ToString(“yy")

Regards,
NaNi

1 Like

Dear Naveen,
You can use Kiran’s solution. I checked it works as per your requirement

“Fis_”+now.AddDays(-1).ToString(“MMM”)+now.AddDays(-1).ToString(“yy”)

Thanks and Regards,
Geetishree Rao

2 Likes

HI @HeartCatcher

So you can give the condition to it

If New DateTime(Now.Year,Now.Month,1).ToString(“dd/MM/yyyy”) = Date.Now.ToString(“dd/MM/yyyy”)

  • Type Into : "FIS_"Date.Now.AddMonths(-1).ToString(“MMMyy”).ToLower

Else:

  • Type Into : "FIS_"Date.Now.ToString(“MMMyy”).ToLower

Regards
Sudharsan

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.