开发者

searching text files

开发者 https://www.devze.com 2023-01-28 08:20 出处:网络
I’m desperately searching for some simple app that searches for text strings开发者_如何转开发 in a specified directory of about 1000 text files. Does anyone know if such a thing exists, or has anyone

I’m desperately searching for some simple app that searches for text strings开发者_如何转开发 in a specified directory of about 1000 text files. Does anyone know if such a thing exists, or has anyone ever programmed such an app?

Thanks Pankaj


I would implement the searching within an NSOperation subclass. It would use file descriptors instead of NSStrings to keep memory usage down. To perform the actual search I would implement an algorithm that doesn't require the input to be indexed, such as the Boyer–Moore string search algorithm. See Efficient way to search a stream for a string for more details.

0

精彩评论

暂无评论...
验证码 换一张
取 消