Re: search string in text file
| From: | Jason Wong | Date: | Mon, 17 Dec 2001 07:52:17 +0000 |
| Subject: | Re: search string in text file | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15062@lists.php.net to get a copy of this message | ||
On Monday 17 December 2001 15:11, Sommai Fongnamthip wrote:
> Hi,
> How could search string (like full text search) in any text file (even
> know or not known filename)?
One way of doing this if you're using a Linux/Unix system is:
$files =
grep -R "search_string" /path/of/directory/to/search/*;
$files would then contain the list of files in which "search_string" was
found.
hth
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Absence is to love what wind is to fire. It extinguishes the small,
it enkindles the great.
*/