Results 1 to 3 of 3

Thread: Find a group of numbers in a file

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    1

    Find a group of numbers in a file

    Hi there i was wondering if someone could help me out. Im trying to make a program that will find this specific group of numbers in a file. Then i want it to pop up in a Text box. Im still learning so take it easy on me. Thanks in advanced.

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Find a group of numbers in a file

    If it is a small text file, you can use System.IO.File.ReadAllText to read all the text into a string variable and then search for what you are looking for using the indexof method.

  3. #3
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Find a group of numbers in a file

    The first thing you'll want to do is read all the lines of the file using IO.ReadAllLines, then you will loop through each line in the results and check if the line contains the group of numbers that you are looking for using String.Contains, if that returns True then you will next show call MessageBox.Show.

    Edit: beat to the punch!

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