Results 1 to 3 of 3

Thread: Streaming Text

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Seattle, WA USA
    Posts
    216

    Streaming Text

    Thanks for all the help tonight guys. I'm trying to open a text file and have portions of the text fill text controls on my form. What's the best way to go about opening a text file and having it read up to a certain point. For example here is a text file:


    This is line 1 of my text file
    this is the second line
    The third line may look like this.
    And the forth is here.


    How can I open a file and have it put whatever is inbetween the word "third" and "forth" and put it in a control?

    Thank again for the help. I'm quite the beginner with text modification and VB.NET

    -- Ethan --
    VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
    MCP & A+ Certified. Looking for a job in the Seattle, WA area.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Did you search the Forum ? It's heavily asked about that.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Seattle, WA USA
    Posts
    216
    I have done a little searching and found some stuff but my question is a little different. Here's an example of almost exactly what the text file will look like:

    #HELP

    -1 TEST~
    ~
    -1 MERC~
    ~
    92 MERC~
    ~
    40 SHIELD 'STONE SKIN'~
    ~
    0 $~

    Ok... to make things easier to understand, $ means the end of the file and #HELP is the start. Each number represents a "Level" and each word or set of words is a "Keyword". Basically, I need to find a way to get each "Keyword" into a big drop-down combo box. Then when I select the "Keyword", the corresponding "Level" will appear in a text box next to it.

    Where's a good place to start. I've looked a little into the following example but I'm not sure it's the best option for me. Let me know what you all think...

    VB Code:
    1. dim SampleStr as String="001,Mickey Mouse ,5000,200"
    2. dim parts() as String=SampleStr.Split(",")
    3. Msgbox(parts(0))
    4. Msgbox(parts(1))
    5. Msgbox(parts(2))
    6. Msgbox(parts(3))
    -- Ethan --
    VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
    MCP & A+ Certified. Looking for a job in the Seattle, WA area.

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