Results 1 to 6 of 6

Thread: [RESOLVED] Extracting certain information

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    89

    Resolved [RESOLVED] Extracting certain information

    Hey there guys, hit another problem. I was bussy on a program and I just felt curious, if in a text box for example. I want to block out certain words, EG.

    Before: john is a good boy
    After: john boy

    So in this example "is a good" is taken out. So if there is one label...

    Label1 with string "yesterday=45 today.harry" (Reading from file). I want to only see "today.harry". I hope you guys can help, thanks...

    Cool
    Last edited by Hack; Jul 28th, 2006 at 11:42 AM. Reason: Added [RESOLVED] to thread title and green "resolved" checkmark

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Extracting certain information

    well it depends, does it follow a pattern? like is there always a space like that?

    replace Data with the name of the variable that has your data in it
    VB Code:
    1. Label1.caption = mid(Data,instr(Data," "),len(Data))
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    89

    Re: Extracting certain information

    Thanks for the response, but that isn't what I am looking for.

    I am looking for code so that the program will clear out some words and leave the rest.

    Example 1:

    "hapy=elen/john3432.long"

    Now, I want to take out "hapy=elen/" and leave "john3432". Keep in mind that
    "john3432" is a random word, so i must just clear out the first few letters, if that is possible. So in other words I am making "hapy=elen/" restriction so that it cannot be put into the text box.

    Example 2:

    Label1.caption = "hapy=elen/john3432.long"

    After the command button has been pressed label must be....

    label2.caption = "john3432.long"

    I Really hope you can help with this, thanks..

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Extracting certain information

    VB Code:
    1. Dim strMyString As String
    2. Dim arrMyString() As String
    3.  
    4. strMyString = "hapy=elen/john3432.long"
    5. arrMyString = Split(strMyString,"/")
    6. Label1.Caption = arrMyString(1)

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    89

    Re: Extracting certain information

    Hey there Hack, thanks alot. That worked... I just changed the code a bit but couldn't of done it with out you, thanks.

    Cool

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Extracting certain information

    Quote Originally Posted by spike_hacker_inc
    Hey there Hack, thanks alot. That worked... I just changed the code a bit but couldn't of done it with out you, thanks.

    Cool
    Posted code examples almost always have to be tweaked to fit the specific needs of the posting member, so that is not unusual at all.

    If you consider this resolved, would you please pull down the Thread Tools menu and click the Mark Thread Resolved menu item? That will let everyone know that you have your answer.

    Thank you.

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