I am new (Java)er. This would sounds easy to me though. 1. Construct an File class with the dir to search 2. Use File.list method to get all the files and dirs in this dir 3. For each file, open a FileInputStream, chain a BufferedInputStream then read line by line and check whether there is the word
use fulltext search engine. that scales up. SQL Server has one. Oracle also has it.
【在 o*********l 的大作中提到】 : Use perl to do so.
x*g
5 楼
非要用这么高深的东西吗? 如果只是自己用的话, 用 shell script 一句话就可以办到. find $1 -type f -exec grep -q -s $2 {} \; -print $1 is the path/dir to begin search. $2 is the keyword to search. hehe.