Fast search in compressed text files

前端 未结 5 629
旧巷少年郎
旧巷少年郎 2021-02-04 18:56

I need to be able to search for text in a large number of files (.txt) that are zipped. Compression may be changed to something else or even became proprietary. I want to avoid

5条回答
  •  心在旅途
    2021-02-04 19:44

    I may be completely wrong here, but I don't think there'd be a reliable way to search for a given string without decoding the files. My understanding of compressions algorithms is that the bit-stream corresponding to a given string would depend greatly on what comes before the string in the uncompressed file. You may be able to find a given encoding for a particular string in a given file, but I'm pretty sure it wouldn't be consistent between files.

提交回复
热议问题