Re: Need Help deleting record from text file
- From: "Mike Williams" <mikea@xxxxxxxxxxxxxxxxx>
- Date: Wed, 26 Sep 2007 21:21:55 +0100
"Dave O." <nobody@xxxxxxxxxxx> wrote in message news:OxQBUbFAIHA.3400@xxxxxxxxxxxxxxxxxxxxxxx
However I would strongly suggest using a database
as it will be substantially faster than a combination of
instr, huge strings and list boxes.
I certainly wouldn't suggest building huge strings or using ListBoxes either, but neither would I suggest using a database. It is just overkill for the task at hand and I doubt very much whether it would produce any significant speed increase over my own suggested method of using one or two sorted VB string arrays. I've just tested a simple binary search algorithm on an ordered 10,000 element array of strings of random size (around 20 to 25 characters each) and it can find any item in the array in about 5 microseconds. That means even the brute force method of individually testing (for example) 9,000 individual randomly ordered strings one at a time against the ordered array of 10,000 strings will take only about one twentieth of a second, or a tenth of a second at worst, to peform the entire task. And to sort the 10,000 element string array in the first place takes only about one fifth of a second. That's hardly a significant amount of time and is certainly just a fraction of the time taken by the code that "reads" the list of files in the directory in the first place. Using a bloated database for such task would not produce any significant speed increase, and it might in fact even slow it down.
Mike
.
- Follow-Ups:
- Re: Need Help deleting record from text file
- From: Dave O.
- Re: Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- References:
- Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Dave O.
- Re: Need Help deleting record from text file
- From: David Kerber
- Re: Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Dave O.
- Need Help deleting record from text file
- Prev by Date: Silly Date/Time Algorithm
- Next by Date: Re: Need Help deleting record from text file
- Previous by thread: Re: Need Help deleting record from text file
- Next by thread: Re: Need Help deleting record from text file
- Index(es):
Relevant Pages
|