searching text files
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 NSString
s 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.
精彩评论