Results 1 to 8 of 8

Thread: A simple program I need to figure out...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    77

    A simple program I need to figure out...

    Hello all, I havent touched VB in a while, I have VB 6.0..
    Basically all I'm trying to do is, Create code for a program to open up one specific document and search it for multiple words i.e hey hello howdy
    I need it to support up to 20 words. Is this possible???

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: A simple program I need to figure out...

    Welcome to the forums!

    Are you talking about a text document, or some other type of file?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    77

    Re: A simple program I need to figure out...

    A text document. Basically we have a counterstrike server... and We have logs for what people say. Instead of seaching them individually for words, I need to do it in forms of 20. will be in a wordpad doc.

  4. #4
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: A simple program I need to figure out...

    you can use the richtextbox control to load the file and search for it.

    to load a file just use:

    VB Code:
    1. Private Sub Command1_Click()
    2. RichTextBox1.LoadFile "c:\my text.txt"
    3. End Sub
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: A simple program I need to figure out...

    If it's a textfile that's less than 64K, you can read it into a buffer, and use InStr() to search for a word. Do you have a list of words that you search for?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    77

    Re: A simple program I need to figure out...

    yes... here they are, and remember I havent did this for a LOOOONG time as to why im here ~

    i search for these words...

    kir
    |KiR|
    psay
    ban
    unban
    kick
    kirclan
    tag on
    stop it
    abuse
    hate rad
    i wish
    admin abuse

    like this, I need help with the code :/

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    77

    Re: A simple program I need to figure out...

    The word's will never change, but more will be added in the future, its on notepad and looks like....

    9804024><CT>" killed "canelon--paz[]--*@lbert*--[]paz<598><STEAM_0:1:8969602><TERRORIST>" with "ak47"
    L 01/22/2006 -

    somthing like that but a WHOLE notepad doc. wayyy over 62k its a month of logs

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    77

    Re: A simple program I need to figure out...

    for instance.... I have a notepad doc saved on my desktop names LOG1

    Private Sub Command1_Click()
    RichTextBox1.LoadFile "c:\log1.txt"
    End Sub

    and I wan't to scan it for lets say 12 words and highlight the text in the document after it opens it.

    Thats it thanks for the quick replys!

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