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

前端 未结 6 1859
抹茶落季
抹茶落季 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:17

    This is a problem connected with your previous question How Can I Efficiently Read The First Few Lines of Many Files in Delphi, and the same answers apply. If you don't read the files completely but in blocks then large files won't pose a problem. There's also a big speed-up to be had for files containing the text, in that you should cancel the search upon the first match. Currently you read the whole files even when the text to be found is in the first few lines.

提交回复
热议问题