Searching multiple files for text or phrases?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandeepkavade
    New Member
    • Mar 2007
    • 30

    Searching multiple files for text or phrases?

    Hi all,
    i want to search for files containing particular phrase, just like windows "A word or phrase in file:" utility in search option. Does anybody knows any windows API or programming logic for this issue?
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Depends which language you are using - will this be implemented in C or C++?

    Comment

    • Studlyami
      Recognized Expert Contributor
      • Sep 2007
      • 464

      #3
      If your not concerned about memory you can open the file and copy it to a CString object then you can use the CString::find() to find the word or phrase. This can take up a lot of memory depending on the file size, but its really easy to program and for what i have noticed it doesn't take a lot of time on the find function, but i haven't used it on larger files (max was probably 30 or so pages of text).

      Comment

      • sandeepkavade
        New Member
        • Mar 2007
        • 30

        #4
        Originally posted by sicarie
        Depends which language you are using - will this be implemented in C or C++?

        it has to be implimented in C++. They are xml files and i have to search for value of particular node. Reading the file and using MSXML is better option or taking it in CString and calling .find() will be a better option.

        Comment

        • sicarie
          Recognized Expert Specialist
          • Nov 2006
          • 4677

          #5
          Yeah, I'd use an XML parser, it sounds like you already know of one (though it's got the "M$" on the front of it, I wouldn't really trust it ;). Feel free to post again during your implementation if you get stuck!

          Comment

          Working...