CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2000
    Location
    Seattle , WA
    Posts
    87

    search for a string in a file

    Hi,

    can some can through some ideas in searching for a string in a file efficiently .

    Thanks,

  2. #2
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    Have a look at http://www.cs.utexas.edu/users/moore...ing-searching/. It is a fairly good starting point. Then look on the net for the two methods mentioned there and the word faster. If there aren't any hits, then possibly no one has formulated a method that is faster than those algorithms.
    Succinct is verbose for terse

  3. #3
    Join Date
    Feb 2002
    Posts
    5,757
    Depending on the type of data file, but there are two primary ways to search a string in a text file. One is via reading one line at a time. A second way is to map the entire file an search the mapped-file.

    Kuphryn

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