Display file "content:" search results - like grep

Have a suggestion for "Everything"? Please post it here.
Post Reply
Zavod
Posts: 4
Joined: Tue May 31, 2016 3:15 pm

Display file "content:" search results - like grep

Post by Zavod »

This request comes from a repeated need, based on one of my frequent uses of "Everything".

TL;DR: Looking for the ability to display the CONTENT of a file, results of a "content:" search.

Example: Let's say I have a LOT of configuration files for a project I'm working on.
Each configuration file may or may not contain a line such as:
FunConfigSetting = 123

If I use the "content:FunConfigSetting" search to find all the files that contain that line, I get the list of files as a result. (good)

But what I *really* need is the equivalent-to-grep results so I can SEE each of those "FunConfigSettings" lines.
Because what I'm really trying to find is that "123"... to see how many files contain "123" vs "456", etc.

So I propose: A way of showing each line that caused the "content:" to match the file in the first place.

In my mind it would work something like grep, with the UI displaying a list of successfully matched files, WITH the individually match lines included on the display.
And then, just to be awesome, you could have a double-click bring you to that line in your file editor. (the simple way to do this would be to let the user configure the command line of their file editor to include the argument for specifying the line to jump to... "MyEditor.exe /L:%LINE%" or similar.

Anyway, I love "Everything". In the last few years it has changed how I interact with the file system. Thank you!
NotNull
Posts: 5236
Joined: Wed May 24, 2017 9:22 pm

Re: Display file "content:" search results - like grep

Post by NotNull »

I don't know if you are running Everything 1.4 or the 1.5 alpha version, but with the latter one you can do the following (simple example; adapt to your needs):
  • Search for

    Code: Select all

    "c:\some folder\"     ext:ini      regex:content:(FunConfigSetting=)(.*)
  • Right-click the header of the resultlist and select Search > Regular Expression Match 2
  • Done
Now your result list will look similar to this:
2022-01-25 18_12_07-1.5.0.1298a (x64) Everything - (1.5a).png
2022-01-25 18_12_07-1.5.0.1298a (x64) Everything - (1.5a).png (29.07 KiB) Viewed 2242 times

The column can be sorted if needed.


Highlighting the content: search text in the preview pane is on the To-Do list, as part of writing a 'home-made' preview handler for plain text files (instead of the one provided by Windows itself)


Note that Everything's regex is case-INsensitive (in it's default setting).

See also link
Post Reply