Check file exists or not with previous date in a folder

Hi,

i have to do a daily check whether a file with previous date exists or not in a folder.

File name will be : XXXX_Previousdaydate.xlsx

Can anyone help on this.

@Palaniyappan : can you look suggest asap.

Thanks

@avinashy What is the Format of Previous Day date in the filename?

Hi @avinashy

Try this one you will get previous day date

image

Regards,
Kommi Jeevan.

1 Like

Hi,

You can try the following steps:

  1. previousDate = Now.AddDays(-1).ToString(“dd.MM.yyyy”)
  2. filePath = “XXXX_”+previousDate+“.xlsx”
  3. folderPath = e .g “C:\Users\Desktop\”
  4. pathExists = folderPath+filePath