Re: Need Help deleting record from text file



"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


.



Relevant Pages

  • Re: K&R2 Secition 5.9 - major blunders
    ... Each element of b doesn't point to a 20 element array of int. ... This mistake is crucial because ... my explanation is really the qualities of something else: ... > The use of the array of pointers is to store the strings. ...
    (comp.lang.c)
  • Re: K&R2 Secition 5.9 - major blunders
    ... Each element of b doesn't point to a 20 element array of int. ... This mistake is crucial because ... my explanation is really the qualities of something else: ... > The use of the array of pointers is to store the strings. ...
    (comp.lang.c)
  • Re: Returning array of strings through callback from unmanaged to
    ... Is the array of strings a jagged array or fixed length array? ... It is imperative that I am able to return the array of strings from the ... I have control over how many strings I want the unmanaged code to return ... What I want to accomplish is to pass a callback function to unmanaged ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: attempting to return values from array from w/in a function
    ... What I get is an array w/ only the most recent array entry. ... I am new to PHP & do not have formal scripting ... you end up comparing strings, but the test you mean probably is simply: ... case 1: {codeblock} ...
    (comp.lang.php)
  • Re: sorting and shuffling array
    ... > I need some help with sorting and shuffling array of strings. ... qsort() library function. ...
    (comp.lang.c)