search-file-list command-line option

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

search-file-list command-line option

Post by NotNull »

Input.txt:

Code: Select all

"C:\Windows\explorer.exe"
"C:\Windows\notepad.exe"
"C:\Windows\regedit.exe"
Command:

Code: Select all

Everything.exe - search-file-list input.txt  -newwindow  -filter Everything

Result:
Search query:

Code: Select all

filelist:""C:\Windows\explorer.exe"|"C:\Windows\notepad.exe"|"C:\Windows\regedit.exe"" 
Result list:
Notepad.exe and regedit.exe are shown. So the first (explorer.exe) fell off the list.

Expected result:
All 3files are shown.

Also tested: Filenames without "" : same result


When I add a 'header' to the file list. like:

Code: Select all

"Filename"
"C:\Windows\explorer.exe"
"C:\Windows\notepad.exe"
"C:\Windows\regedit.exe"
The query is:

Code: Select all

filelist:""Filename"|"C:\Windows\explorer.exe"|"C:\Windows\notepad.exe"|"C:\Windows\regedit.exe"" 
And all 3 files are shown in the result list.

(also created a file named "FileName" (without extension). It is not shown in the result list, as expected based on previous behaviour.


Question:
What syntax to use in Input.txt? (or is this a bug?)


BTW: Version 1.4.1.1005 (x64)


EDIT:
Tested on a different system where 1.4.1.935 (x64) is installed.
Here all 3 files are shown in the result list (and with the added "FileName" header, files named 'Filename' are found too).
horst.epp
Posts: 1447
Joined: Fri Apr 04, 2014 3:24 pm

Re: search-file-list command-line option

Post by horst.epp »

NotNull wrote: Mon Feb 08, 2021 2:52 pm Input.txt:

Code: Select all

"C:\Windows\explorer.exe"
"C:\Windows\notepad.exe"
"C:\Windows\regedit.exe"
Command:

Code: Select all

Everything.exe - search-file-list input.txt  -newwindow  -filter Everything

Result:
Search query:

Code: Select all

filelist:""C:\Windows\explorer.exe"|"C:\Windows\notepad.exe"|"C:\Windows\regedit.exe"" 
Result list:
Notepad.exe and regedit.exe are shown. So the first (explorer.exe) fell off the list.

Expected result:
All 3files are shown.
...
For me your example works and shows all 3 files !
Using Everything Version 1.4.1.1005 (x64)
Screenshot - 08.02.2021 , 18_10_05.png
Screenshot - 08.02.2021 , 18_10_05.png (17.57 KiB) Viewed 15767 times
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search-file-list command-line option

Post by NotNull »

horst.epp wrote: Mon Feb 08, 2021 5:08 pm For me your example works and shows all 3 files !
Thanks for testing this, Horst!
That helps. Now I have to figure out where I messed up this time ...


For the record, this is what I see:
2021-02-08 19_13_38-Everything 1.4.1.1005 (x64).png
2021-02-08 19_13_38-Everything 1.4.1.1005 (x64).png (12.85 KiB) Viewed 15758 times
horst.epp
Posts: 1447
Joined: Fri Apr 04, 2014 3:24 pm

Re: search-file-list command-line option

Post by horst.epp »

NotNull wrote: Mon Feb 08, 2021 6:16 pm
horst.epp wrote: Mon Feb 08, 2021 5:08 pm For me your example works and shows all 3 files !
Thanks for testing this, Horst!
That helps. Now I have to figure out where I messed up this time ...


For the record, this is what I see:
2021-02-08 19_13_38-Everything 1.4.1.1005 (x64).png
I see the diff, I tested using the command line example which shows all 3 files.
If I enter the filelist in the Everything search it only shows 2 files as you see it.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search-file-list command-line option

Post by NotNull »

Thanks!
I also ran the command; the screenshot was the result of that.

BTW: Advanced Search behaves (here) strange too:
Search for a list of filenames:
Browse .. input.txt will strip the first entry too.

(filenames need to be without "" for that; otherwise you (or better: I) get zero results).


Also tested with a clean ini: same issue.

I'm officially puzzled :?
Will chew on it a little more...
froggie
Posts: 301
Joined: Wed Jun 12, 2013 10:43 pm

Re: search-file-list command-line option

Post by froggie »

Capture.png
Capture.png (43.84 KiB) Viewed 15750 times
It didn't work, it didn't work, and then it did.

Why is the first file not boldface?
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search-file-list command-line option

Post by NotNull »

froggie wrote: Mon Feb 08, 2021 8:05 pm Why is the first file not boldface?
I think because your search isn't between "" so you get:
filelist:C:\Windows\notepad.exe
-or-
C:\Windows\explorer.exe
-or-
C:\Windows\regedit.exe

The filelist: isn't highlighted; regular searches (the last 2) are.


What happens with the following search?

Code: Select all

filelist:"C:\Windows\explorer.exe|C:\Windows\notepad.exe|C:\Windows\regedit.exe"
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search-file-list command-line option

Post by NotNull »

So I tried different Everything versions, different settings. I am (almost) certain that it isn't Everything''s fault as they work fine on a different system.

It might be related to the Windows (or API) version:
No Everything version works correctly on a system with 1909 (x64); All Everything versions work correctly on a system with 2004 (x64).

(TBH: I didn't tested *all* 1005 different versions ...)
froggie
Posts: 301
Joined: Wed Jun 12, 2013 10:43 pm

Re: search-file-list command-line option

Post by froggie »

What happens with the following search?

Code: Select all

filelist:"C:\Windows\explorer.exe|C:\Windows\notepad.exe|C:\Windows\regedit.exe"


If I type it in, it works fine. (No Highlights)

If I cut and paste from your post, it fails

Cut and paste from your post to a text editor and I get:
filelist:?"C:\Windows\explorer.exe|C:\Windows\notepad.exe|C:\Windows\regedit.exe"


Delete first ":" and retype it and it works.
void
Developer
Posts: 16752
Joined: Fri Oct 16, 2009 11:31 pm

Re: search-file-list command-line option

Post by void »

The syntax for filelist: is:

filelist:"c:\folder\file1.txt|c:\folder\file2.txt|c:\folder\file3.txt"

The OR (|) must be escaped with double quotes.

-Without escaping | Everything is seeing
filelist:c:\folder\file1.txt|c:\folder\file2.txt|c:\folder\file3.txt
as:
filelist:c:\folder\file1.txt OR c:\folder\file2.txt OR c:\folder\file3.txt
Note that only the first item has the filelist: search function, the other two terms are regular search terms.


The -search-file-list command line option expects a filename on each line (without the quotes) for TXT files.

I've added to my TODO list to add support for double quotes in -search-file-list <file.txt>

matching filelist: results are not highlighted.

Everything checks the extension of the filename passed to -search-file-list, if the extension is CSV or EFU, then the Filename header must exist and filenames can be escaped with double quotes.
As for TXT, the filenames are treated as is (double quotes are treated literally).
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search-file-list command-line option

Post by NotNull »

That gives me a workaround - using a CSV file - for what I want to accomplish. Thanks!

Do you have an explanation why using the following search excludes the first file - notepad.exe - from the result list (under certain, at this moment unknown, circumstances?

Code: Select all

filelist:"C:\Windows\notepad.exe|C:\Windows\explorer.exe|C:\Windows\regedit.exe"

Or simpler:

Code: Select all

filelist:"c\windows\explorer.exe"
doesn't return any results.
void
Developer
Posts: 16752
Joined: Fri Oct 16, 2009 11:31 pm

Re: search-file-list command-line option

Post by void »

Looks like you have a UTF-8 BOM at the start of the file.

This should be fixed for TXT files the next major version of Everything (Everything will skip over the UTF-8 BOM)

Currently, Everything is searching for:
filelist:"<UTF-8 BOM>C:\Windows\notepad.exe|...

The UTF-8 BOM is skipped for CSV and EFU files.

Note: the UTF-8 BOM is only skipped at the start of the stream. It will not be skipped if it appears inside double quotes.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search-file-list command-line option

Post by NotNull »

:shock: Yes, that was it! Good catch!

Now @froggie's comment makes more sense too:
froggie wrote: Tue Feb 09, 2021 1:20 am Delete first ":" and retype it and it works.
I specifically save my file ("input.txt") as UTF8 in my code, but while experimenting this got removed. Missed that completely ..


Again: Thanks!!

(Now I can finally post my "TimeFilter tool" !)
Post Reply