Results 1 to 9 of 9

Thread: [RESOLVED] How To Find Multiple Words In Text File

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Resolved [RESOLVED] How To Find Multiple Words In Text File

    Hi
    i have a text file which contain 149000 Words 1 Word Per Line
    I want to Search Words Who end with "sd" or something else i am using a listbox in which i load all text and then search for it i don't want to know how to search directly from text file listbox method take too much time any help Plzzzzzzzzzzzzzzzzzz

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: How To Find Multiple Words In Text File

    try this:

    vb Code:
    1. Dim words() As String = IO.File.ReadAllLines(filename)
    2. Dim endingWith = (From word In words _
    3.                          Where word.EndsWith("sd") _
    4.                          Select word).ToArray

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: How To Find Multiple Words In Text File

    don't forget to mark your thread RESOLVED

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: How To Find Multiple Words In Text File

    Thanks

    But How to show the word in textbox ?

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: How To Find Multiple Words In Text File

    it's multiple words, so your txtbox must be multiline

    textbox1.lines = endingWith

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: How To Find Multiple Words In Text File

    Thanks Man

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: [RESOLVED] How To Find Multiple Words In Text File

    Hi I got this error in end when i add the code in my final project how to resolve it ?
    Error 1 Expression of type '1-dimensional array of String' is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider.

  8. #8
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [RESOLVED] How To Find Multiple Words In Text File

    check your references:
    Attached Images Attached Images  

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: [RESOLVED] How To Find Multiple Words In Text File

    Oh Thanks

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