4 ms·
It suddenly strike me that in a compressed file, you don't have to decompress then grep, you can grep for Huffman table and know exactly where the occurrences a
by est 12y ago
It suddenly strike me that in a compressed file, you don't have to decompress then grep, you can grep for Huffman table and know exactly where the occurrences are.
- deleted 12y ago[deleted]
- jimktrains2 12y agoThe table doesn't contain the location in the file, only a mapping of bit sequence to original sequence. LZW also doesn't contain information on where sequences are. However, you could construct the compressed version of your search string and search for it (or in the case of LZW, generate it as you continue to search and decompress only small portions as needed). Either way, you still have to go through the file. at least once. EDIT: Actually, if your search string falls inside a compression block, it may be more difficult without uncompressing (and then discarding).
- xfs 12y agoThe search patterns don't usually align at byte boundary.