Excel File input to be Picked by exact todays date

Hi Expert,

User has to place the input file (CSV or excel )on daily basis with zip format and it name contains GST Hold Report 20231228. filename will contain todays date format as yyyy/MM/dd. every day data has changed file name accordingly. How can achieve this to BOT find and pick exact of todays date file? Sample input is attached for your reference.

Regards,
Balachander P
GST Hold Report 20231228.zip (76.9 KB)

Hi @Balachander_Pandian

You can create a string variable to store the today’s date.

- TodayDate = Now.toString("yyyy/MM/dd")

Use for each file in folder activity to iterate the each file in the folder. Inside for each insert the If condition to check the file name.

- Condition -> CurrentFile.Name.equals(TodayDate)

Inside then block you can place other activities for further process.

Hope it helps!!

Hi @Balachander_Pandian

Assign 
FilesArray = Directory.GetFiles(DirectoryPath, "GST Hold Report " + DateTime.Now.ToString("yyyyMMdd") + "*.zip")
For Each file In FileArray
    If file.Contains(DateTime.Now.ToString("yyyyMMdd"))
        \\Process to do
    End If

Hi @Balachander_Pandian

todayDateString = DateTime.Now.ToString(“yyyyMMdd”)
fileArray = Directory.GetFiles(“YourFolderPath”, “GST Hold Report " + todayDateString + ".zip”)

If fileArray.Count > 0
Then
’ Proceed with the file in fileArray(0)
Else
’ Handle the case where no file is found

Hi @pravallikapaluri thanks for the response … Can you please share code of sequence?

@Balachander_Pandian
Forum.zip (232.4 KB)

Hope it helps!!

@pravallikapaluri thank you

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