How to select Specific Files for a Folder

Hello All,

We have 2 Files in folder say one is Test.pdf and Other is Test_1.pdf. Here we need to select only Test_1.pdf. But the issue the that After “Test_”, Number is not known to us. It can Test_2 or Test_3 or etc. How to select required file.

Hi @Ripusudan_Sharma

How do you know which is the required file?

give it a try at the following.

Directory.GetFiles(YourFolderPath, "Test_*.pdf)

Hi @Ripusudan_Sharma

Do you need the latest numbered file?

If so please use this expression to retrieve the files

Directory.GetFiles(YourFolderPath, "Test_*.pdf)

Later sort it with file name you’ll be able to get the latest file.

Thanks
Happy Automation

1 Like

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