Look for an excel sheet with a specific name in the folder

Is it possible to look for an excel file with a particular name within the folder.
Example.If I have a id say JHY456 and firstly I want to look for a file name within a folder starting with the same name as my id JHY456 and want to open it and then write the data within that file.
Could anyone guide me a bit …as how to do this ?

1 Like

Hi @kartik_sareen

Yes you can use

 Directory.GetFiles("yourDirectoryPath","*.pdf or excel")

This will return an array of file names, then have a for each loop and apply if condition in it something like this


Then you can do the operations further accordingly



thanks a lot Prankur…

1 Like