Tech Support > Microsoft Windows > Development Resources > How to locate words in a text file?...
How to locate words in a text file?...
Posted by Kellie Fitton on February 14th, 2005


Hello,

Is there a win32 API that will help me find a specific word or
words in a text file? For example, if I open a text file and
want to locate the word "Hello" -- if this word exist, then the
function would highlight the word and its location in the file.

thanks for the help. Kellie.

Posted by Matt Gregory on February 15th, 2005


Kellie Fitton wrote:
You can use strstr() or StrStr() for case sensitive searches or
StrStrI() for case-insensitive, assuming the text file is all
in one string.

Matt Gregory

Posted by Kellie Fitton on February 15th, 2005



Matt Gregory wrote:

Kellie Wrote:

Thak you.

Kellie.


Posted by Sten Westerback on February 15th, 2005



"Kellie Fitton" <KELLIEFITTON@YAHOO.COM> wrote in message
news:1108441407.230361.65210@z14g2000cwz.googlegro ups.com...
Unless your teacher require that you write the search code yourself...

- Sten




Posted by Matt Gregory on February 15th, 2005


Sten Westerback wrote:

Hmm. Well, doesn't typing up the strstr() call count? :-)

Matt Gregory

Posted by Jussi Jumppanen on February 16th, 2005


Matt Gregory wrote:
Another option is to load the file into a Rich Edit control
and then use the EM_FINDTEXT message to do the text search.

Jussi Jumppanen
Author of: Zeus for Windows (New version 3.93 out now)
"The C/C++, Cobol, Java, HTML, Python, PHP, Perl programmer's editor"
Home Page: http://www.zeusedit.com


Similar Posts