Fast Search to see if a String Exists in Large Files with Delphi

前端 未结 6 1873
抹茶落季
抹茶落季 2020-12-14 13:31

I have a FindFile routine in my program which will list files, but if the \"Containing Text\" field is filled in, then it should only list files containing that text.

<
6条回答
  •  孤城傲影
    2020-12-14 14:04

    If you are looking for text string searches, look for the Boyer-Moore search algorithm. It uses memory mapped files and a really fast search engine. The is some delphi units around that contain implementations of this algorithm.

    To give you an idea of the speed - i currently search through 10-20MB files and it takes in the order of milliseconds.

    Oh just read that it might be unicode - not sure if it supports that - but definately look down this path.

提交回复
热议问题