Can we use wild cards in a file name, if yes how to wild wild cards for a file namw with dynamic data in the end. eg1: “D:\Report 03-04-2018 Job No 1988.txt” , eg2: “D:\Report 03-04-2018 Job No 191.txt”. i want to use wild card after job no or any alternate solution.
You can do like this.
Get all the list of Files by using
Directory.GetFiles(“Folder Path”) and store it in a listA
Then you can get the List of files as per your requirement.
List B=ListA.FindAll(Function(x) x.ToString.Contains("D:\Report "+DateTime.Now.ToString("dd-MM-yyyy"))