-
Aug 30th, 2011, 04:30 AM
#1
Thread Starter
Fanatic Member
Search string in multiple files.
i need to check a text in a lakh of files. as now am looping through files, is there any other fast approach to make it work easily.
Visual Studio.net 2010
If this post is useful, rate it
-
Aug 30th, 2011, 05:05 AM
#2
Re: Search string in multiple files.
are the files all in 1 folder?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 30th, 2011, 05:11 AM
#3
Re: Search string in multiple files.
vb Code:
Dim relevantFileNames As ReadOnlyCollection(Of String) = My.Computer.FileSystem.FindInFiles(My.Application.Info.DirectoryPath, ComboBox1.Text, False, FileIO.SearchOption.SearchTopLevelOnly, "*.txt")
FindInFiles parameters are:
- directory to search
- text to find
- ignore case
- search options
- file wildcards
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 30th, 2011, 05:12 AM
#4
Re: Search string in multiple files.
Consider using the windows default file search
My.Computer.FileSystem.FindInFiles Method
Edit:Little slow in posting
Please mark you thread resolved using the Thread Tools as shown
-
Aug 30th, 2011, 05:48 AM
#5
Thread Starter
Fanatic Member
Re: Search string in multiple files.
Originally Posted by .paul.
are the files all in 1 folder?
yes.. but having subfolders..
Thanks,paul & Dana.. i check and come back..
Visual Studio.net 2010
If this post is useful, rate it
-
Aug 31st, 2011, 02:33 AM
#6
Thread Starter
Fanatic Member
Re: Search string in multiple files.
Findinfiles looping through all files(Pls refer this..).. its taking much time in directory.getfiles().
Is there any other API which uses Search using some indexing techniques? i need the data in seconds..
Visual Studio.net 2010
If this post is useful, rate it
-
Aug 31st, 2011, 05:07 AM
#7
Re: Search string in multiple files.
Originally Posted by vijy
Findinfiles looping through all files( Pls refer this..).. its taking much time in directory.getfiles().
Is there any other API which uses Search using some indexing techniques? i need the data in seconds..
The link says Data base connection Error. Do you want to search only in few file types . If yes the consider using the wild cards
Code:
Dim value As System.Collections.ObjectModel.ReadOnlyCollection(Of String) =
My.Computer.FileSystem.FindInFiles(directory ,containsText ,ignoreCase ,searchType ,"*.txt")
Read the example here
Please mark you thread resolved using the Thread Tools as shown
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|