I am trying to write program its like a simple search engine, in this program the user is supposed to enter a search keyword into an edit box and then he can click the search button, and the program is supposed to open a specific text file from the directory and find a matching word to that keyword in this text file. I am using Delphi 2007. thank you
A:
Basically you need to find a string in another string. Take a look at this algorithm: http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
stribika
2009-07-16 23:57:13
A:
I have written something similar in C# - Searcharoo.net - you can download the source code from there.
What might be more useful, though, are the articles that I wrote describing how it works... This description of how Version 1 might be of some use - although I'm probably biased since I wrote it (back in 2004).
Your question is pretty open so I'm not sure if this will help - particularly since I don't know Delphi and how different it is to C# - but hope it helps...
CraigD
2009-07-17 00:04:11
+1
A:
If you are on a unix system, send a call to grep
. If you are on a windows system, install grep for windows.
hashable
2009-08-14 20:49:28
Actually, Delphi comes with grep...
Jeroen Pluimers
2009-10-16 06:02:49