I need to search a string or text in around 2000 files. Input string is coming from an excel document.
Basically I need to search if UserName exists in 2000 excel files placed at shared location. there are around 3000 users for which I need perform this search. I have developed below code by searching on google but it is taking 3 mins for each user which is too long. Please suggest better way.
Public Shared Function Search(ByVal SearchText As String, ByVal FolderPath As String) As List(Of String) Dim searchresult As List(Of String) = New List(Of String) Dim list As ObjectModel.ReadOnlyCollection(Of String) list = My.Computer.FileSystem.FindInFiles(FolderPath, SearchText, True, FileIO.SearchOption.SearchTopLevelOnly) searchresult = list.Select(Function(a) a).ToList() 'For Each name In list ' searchresult.Add(name) 'Next Return searchresultEnd Function