CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: File Search

  1. #1
    Join Date
    May 1999
    Posts
    1

    File Search

    I'm a AP student at a high school loking for some help with a problem i'm having....

    I was wonder how i would go about searching for text in a .txt file for .dat file without reading it into an array...

    Thank You

    -Argonic


    Scott Miller

  2. #2
    Join Date
    May 1999
    Location
    Antwerp, Belgium
    Posts
    136

    Re: File Search

    This is one possible solution :

    Read a char from the file. If the char is equal to the first char of the searchstring then add one to a counter. Read the next char and check it with the second(= counter) char of your searchstring. If the char is not equal reset counter to 0. If counter is equal to the length of your searchstring then you have found the string in the file.


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

Featured