Results 1 to 6 of 6

Thread: parsing a delimited string, FAST??

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Finland
    Posts
    13

    Question

    Hi ho!

    Anyone know of a quick way, besides writing a supporting .dll in c, to parse tokens out of a string delimited by an arbitrary number of tabs and spaces?

    My function uses a few replace()-functions and a split()-function to get the tokens in to an array, but when there's something like 35 000 lines in a file, the wait gets a tad boresome for the user..

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Time to write your own function methinks.

    To get you started, here is an example of a very quick split function.

    The basic principle is that you use a couple of pointer to bits of the string using InStr(), and then extarct the bit with mid$()

    Need any more help, just ask.
    Iain, thats with an i by the way!

  3. #3
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Thumbs up

    hahahhaha

    I knew that Iain17 would be here advertising that function of his again!!!

    It is fast though, especially on large text strings
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  4. #4
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Sorry. *hangs head in shame*

    I can't seem to help myself. I can't help with a lot of problems becuse i know very little (ie nothing) about API, and some of the other questions.

    What i am good at is writing algorithims for people, and when you find a good one, you want everyone to know about it.
    Iain, thats with an i by the way!

  5. #5
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    I'm not too experianced with the API either, I've got a few books but not many projects that really need API, just a few little calls here and there.
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  6. #6
    Guest
    just thought I'd get a plug in while were on the subject:

    My CSV ---> Fixed width control is nearly complete, will be available soon!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width