No announcement yet.

Fastest way to find a string in a file with PBDOS?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Fastest way to find a string in a file with PBDOS?

    Can somebody please help me, Im having great difficulties with this in PBDOS, but its very easy in PBDLL/PBCC... all I want to do is look for a string in a file

    In PBDLL or PBCC Id use something like this:
    Dim FileData$
    Open FileName$ For Binary Access Read As #1
     FileData$ = Space$(LOF(1))
     Get #1, 1, FileData
    Close #1
    StringPosition = Instr(1, FileData$, "string to search for")
    In PBDOS im being limited to 32kb strings so its thrown a spanner into the works!
    Anyone ?
    Thanks in advance, this one has really got me stumped and I can't proceed until I get this sorted out


  • #2

    You can use in pb3.5 virtual strings -but they are -very- slow.

    The best way is to pick up file-sticks between 1 - 32 kb in

    a logical way - beware of the end of line bzw. the lenght of

    the record to cut the chunks not between a word.

    Next step is to search in this string for the result. Then

    read in the next and so on ... until you find it.

    I´ve found, that a smaller 'get-in-string' between 1-5 kb is

    faster then the full lenght of 32 kb.


    Matthias Kuhn



    • #3
      wayne, you appear to have asked this before...

      powerbasic support
      mailto:[email protected][email protected]</a>
      mailto:[email protected]


      • #4
        Lance, sheesh - I even started that post with "(I promise this is my last question)"
        Well, thanks everyone again for solving this a few months ago .... sorry, it's just been one of those weeks
        Can get back to work now and leave you all alone! thanks