Search within 7z, RAR, and zip files

Discussion related to "Everything" 1.5 Alpha.
Post Reply
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Search within 7z, RAR, and zip files

Post by harryray2 »

Do you have a timeline for adding the ability to search within content within compressed files? Not just filenames but text within the compressed files.

At the moment I'm using DNgrep.

Thanks.
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search within 7z, RAR, and zip files

Post by void »

No, sorry.

It is on my TODO list.
ChrisGreaves
Posts: 697
Joined: Wed Jan 05, 2022 9:29 pm

Re: Search within 7z, RAR, and zip files

Post by ChrisGreaves »

void wrote: Thu Dec 22, 2022 9:50 pmIt is on my TODO list.
Hi Void; you'll never guess why I am joining this thread :evilgrin:

I did a search for content zip* and could not find a post that discussed what I thought should be, by now, a feature of Everything.
zippedFiles.jpg
zippedFiles.jpg (89.61 KiB) Viewed 479 times
I have a collection of ZIPped files, A common practice for me is to create a ZIP file at milestones in a project.

I want to identify all files within the eight ZIP files are DOCuments of DOTemplates containing the string "paper".
I essayed with

Code: Select all

u: ext:zip content:paper
with no success.

I reason that by now there must be a way to tell Version 1.5.0.1383a (x64) to examine the content of files within a zip file, without me having to unzip all the zip files (eight in U: but as many as 100 zip files in other projects) into a working folder just to do the content search.
I am thinking of some sort of "drill down" switch that would force examination of the files within a ZIP file, even to the matter of unzipping zip files stored inside a zip file.

If you or anyone can remember where this is discussed I'll be delighted to trot off and study how to do it.
Thanks, Chris
horst.epp
Posts: 1456
Joined: Fri Apr 04, 2014 3:24 pm

Re: Search within 7z, RAR, and zip files

Post by horst.epp »

You have to search in Container:

From the help web pages

container-file-name:
container-file-names:
rar-file-name:
rar-file-names:
zip-file-name:
zip-file-names:
7z-file-name:
7z-file-names:

Search container files for the specified semicolon (;) delimited list of filenames.

Examples:
container-file-name:Everything.exe
container-file-name:Everything.exe;Everything.chm
regex:container-file-name:^Everything
Phlashman
Posts: 45
Joined: Sun Sep 11, 2022 4:57 am

Re: Search within 7z, RAR, and zip files

Post by Phlashman »

I think the question was not so much to find files within Container files by filename, but more by type eg. DOC or DOT AND within them contain the string "paper"
Can Everything "content search" files within Container files?
ChrisGreaves
Posts: 697
Joined: Wed Jan 05, 2022 9:29 pm

Re: Search within 7z, RAR, and zip files

Post by ChrisGreaves »

Phlashman wrote: Fri Dec 13, 2024 9:20 pmI think the question was not so much to find files within Container files by filename, but more by type eg. DOC or DOT AND within them contain the string "paper" Can Everything "content search" files within Container files?
Correct! And thank you for clarifying my issue.

This is part of what I suspect is a larger challenge.
For example, using "container" in a general sense, I consider a MSWord (or MSExcel etc.) template to hold a Project which itself holds a set of Modules which themselves hold Strings of characters.

We humans make those strings visible by using Alt+F11 to open the code for editing,which Everything would need to know to do.

But there must be many, many types of"containers" besides ZIP files and VBA projects.
Zip files wh9ich contain other ZIP files is one example.

Thanks again, Chris
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search within 7z, RAR, and zip files

Post by void »

To search compressed files containing a 'document' file:
containerfilename:doc:


doc: will expand to your document filter search. eg: ext:doc;docx;txt;html;pdf;etc...

Everything doesn't have support to search content inside zip files. yet..
Phlashman
Posts: 45
Joined: Sun Sep 11, 2022 4:57 am

Re: Search within 7z, RAR, and zip files

Post by Phlashman »

That gives a list of containerfiles .eg zip files but what do we add to get the name of the "doc:" filenames found?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search within 7z, RAR, and zip files

Post by void »

Code: Select all

*.zip multistring:regex:containerfilename:(.*\.(asm|c|cc|chm|cpp|cs|css|csv|cxx|doc|docm|docx|dot|dotm|dotx|efu|epub|h|hpp|htm|html|hxx|ini|java|js|json|lua|md|mht|mhtml|mobi|odp|ods|odt|pdf|php|pl|potm|potx|ppam|pps|ppsm|ppsx|ppt|pptm|pptx|ps1xml|pssc|pub|py|rtf|sldm|sldx|sql|tsv|txt|vb|vsd|wpd|wps|wri|xlam|xls|xlsb|xlsm|xlsx|xltm|xltx|xml|xsl))$ add-column:1
The first match is shown in the Regular Expression Match 1 column.

multistring:
Phlashman
Posts: 45
Joined: Sun Sep 11, 2022 4:57 am

Re: Search within 7z, RAR, and zip files

Post by Phlashman »

This as you say this gives first match? but if you want to list all the files with the extensions eg.all the .doc files, one per line, in the zip files, how do we do that?

*.zip regex:containerfilename:(.*\.doc)$ add-column:1 gives only one .doc file per zip file
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search within 7z, RAR, and zip files

Post by void »

Everything is not really designed to list all occurrences of the regex pattern.

All occurrences are highlighted if you show the container filename column.
Include the following in your search:
add-column:container-filename


To show the first 9 matches:

Code: Select all

*.zip add-column:regmatches global:nomultistring:regex:containerfilenames:(?:^|;)([^;]*\.(?:asm|c|cc|chm|cpp|cs|css|csv|cxx|doc|docm|docx|dot|dotm|dotx|efu|epub|h|hpp|htm|html|hxx|ini|java|js|json|lua|md|mht|mhtml|mobi|odp|ods|odt|pdf|php|pl|potm|potx|ppam|pps|ppsm|ppsx|ppt|pptm|pptx|ps1xml|pssc|pub|py|rtf|sldm|sldx|sql|tsv|txt|vb|vsd|wpd|wps|wri|xlam|xls|xlsb|xlsm|xlsx|xltm|xltx|xml|xsl))(?=;|$)
global:
Unfortunately, global: doesn't work with multi-value strings.
ChrisGreaves
Posts: 697
Joined: Wed Jan 05, 2022 9:29 pm

Re: Search within 7z, RAR, and zip files

Post by ChrisGreaves »

void wrote: Fri Dec 13, 2024 11:36 pmEverything doesn't have support to search content inside zip files. yet..
Thank you Void; I am still learning; and knowing that something can't be done saves me hours of searching the forum for "how to do it"!
Cheers, Chris
Post Reply