Marxist Ali
Marxist Ali

Reputation: 65

What is the best and fastest technique in .Net for searchin a string into a large file/folder upto 1GB?

I want to search a string (in every 5 to 10 mints) in text files or folder which might be of 500MB space. I want to know which technique would be fruitful to implement this searching. Please let me know if anything was unclear. I am using csharp.net.

Thanx & Regards

Upvotes: 0

Views: 143

Answers (2)

Vincent Vancalbergh
Vincent Vancalbergh

Reputation: 3327

You can use the Windows Desktop Search API (see here) to perform your search.

Upvotes: 0

Skizz
Skizz

Reputation: 71070

The first thing to do is to write something that achieves your desired result.

Then use a profiler to determine what is taking the longest time!

Once you've found the bit that takes the longest time, see if there's any way to improve that.

Now, from your question, I can probably determine that the bit that's going to take the longest will be the transfer of the data from the hard drive to RAM. If the file contains different data each time you search it then this will define the upper limit of how fast you can do the search. If the file does not change then there's a few possibilities to improve the upper limit.

But first, find out what's taking the time.

Upvotes: 2

Related Questions