Re: Fast File Searching

From: Joep (Staat_at_DeStoep.nl)
Date: 02/12/05


Date: Sat, 12 Feb 2005 17:46:45 +0100

Who is writing to all those files you talk about?

<bo_dong@yahoo.com> wrote in message
news:1108082691.009250.56590@l41g2000cwc.googlegroups.com...
> In my application, I often need to do searches similiar to VLookup
> function in Excel.
> My usual solution looks like this:
>
> StreamReader sr = new StreamReader(file);
> while ((line = sr.ReadLine()) != null)
> {
> string[] items = line.Split('\t');
> if (items[0].Equals(key))
> {
> return items[1];
> }
> }
>
> This solution is slow when searching through thousands of tab delimited
> files in different folders.
> Is there a faster way to accomplish this? Would binary files be better
> for searching?
> Any good books on file streams, disk IO?
>
> Thanks!
>



Relevant Pages