My excel file saves with date like output_13_05_2019. Now i want to get today and yesterday file in variable for comparing data. how to do

My excel file saves with date like output_13_05_2019. Now i want to get today and yesterday file in variable/folder for comparing data. how to do.

My bot has to compare the data. It has to compare today data with yesterday data. So i need to get today and yesterday excel file from folder.

@Puneet_Singh1

Try this:

For Today file:

todayFile[0] = Directory.GetFiles(“Folder Path”, “output_”+now.Tostring(“dd_MM_yyyy”))

For Yesterday File:

yesterdayFile[0] = Directory.GetFiles(“Folder Path”, “output_”+now.AddDays(-1).Tostring(“dd_MM_yyyy”))

1 Like