Find files that do not exist 🤔
Find files that do not exist 🤔
Hello Forum,
I have a list of 40 file names, and I would like to find out which of them do not exist on my hard drive.
Is this possible?
I have a list of 40 file names, and I would like to find out which of them do not exist on my hard drive.
Is this possible?
Re: Find files that do not exist 🤔
As a start...
distinct:name
or
unique:name
(depending on how you want to look at things,
& then depending on what turns up, or not)
& copy/paste your 40 filenames after "name ".
So,
When you copy/paste the file names into the Search bar, the OR's (|) should automatically be placed in there.
(So you copy; file1 file2 file3... & when you Paste, you get file1 | file2 | file3...)
"file1" "file2" "file3" is rather vague, so you might have to finagle things if you're getting more then wanted.
distinct:name
or
unique:name
(depending on how you want to look at things,
& then depending on what turns up, or not)
& copy/paste your 40 filenames after "name ".
So,
distinct:name file1 | file2 | file3 | file4 | file5 | file6
When you copy/paste the file names into the Search bar, the OR's (|) should automatically be placed in there.
(So you copy; file1 file2 file3... & when you Paste, you get file1 | file2 | file3...)
"file1" "file2" "file3" is rather vague, so you might have to finagle things if you're getting more then wanted.
Re: Find files that do not exist 🤔
Not sure if I get how this approach works.
If I search for, I seem to get unique occurrences of any of the input file names.
But how do I see which of the file names have not been found?
If I search for
distinct:name file1 | file2 | file3 | file4 | file5 | file6
But how do I see which of the file names have not been found?
Re: Find files that do not exist 🤔
Don't think that is possible within Everything.
Using the command-line tool ES.exe this should be possible.
What goes your list of files look like? One of the following 4 or something else?
Using the command-line tool ES.exe this should be possible.
What goes your list of files look like? One of the following 4 or something else?
Code: Select all
"C:\Windows\notepad.exe"
"C:\Windows\explorer.exe"
Code: Select all
C:\Windows\notepad.exe
C:\Windows\explorer.exe
Code: Select all
"notepad.exe"
"explorer.exe"
Code: Select all
notepad.exe
explorer.exe
Re: Find files that do not exist 🤔
It's actually just a list of character strings, and I'd like to find out which character string does not occur in any file name.
Re: Find files that do not exist 🤔
If I understood correctly, this should work:
- save your strings in strings.txt (one per line)
- in CMD go the folder where strings.txt is.
- make sure es.exe is either in this folder or somewhere in %PATH%
- run the following command:
This will list all patterns that are not in any file-/foldername.
- save your strings in strings.txt (one per line)
- in CMD go the folder where strings.txt is.
- make sure es.exe is either in this folder or somewhere in %PATH%
- run the following command:
Code: Select all
for /f "delims=" %f in (strings.txt) do @for /f "usebackq delims=" %x in (`es.exe "%f" -getresultcount`) do @if [%x]==[0] echo %f
Re: Find files that do not exist 🤔
Thanks!
This is a bit over my head, but I'll try it as soon as the use case comes up again!
This is a bit over my head, but I'll try it as soon as the use case comes up again!
Re: Find files that do not exist 🤔
Subtitles for this command:
For each pattern (=line) in strings.txt, let es.exe search for that that pattern and report the number of results.
If the number of results is zero, show the pattern on the screen.
For each pattern (=line) in strings.txt, let es.exe search for that that pattern and report the number of results.
If the number of results is zero, show the pattern on the screen.
-
- Posts: 684
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Find files that do not exist 🤔
NotNull, thanks for the subtle subtitles.
Sad to relate they have not gotten me over the hurdle this time.
(1) I have es.exe set up correctly and it executes basic search commands, so I know I am running non-administrator, es.exe in same folder etc
es.exe -instance 1.5a *.doc dm:=02/08/2023
(2) Using your string as-is failed with the same dreaded IPC error, and yes, Everything 1.5a is running :- (3) NOTHING stops me: I carve chunks out of your command and that works; my STRINGS.TXT is in my application folder and contains the names of two towns: (4) THIS stops me because the rest of the command line defies my attempts to carve smaller bits out of it. In particular the usebackq is unfamilar to me.
That the IPC error occurs twice suggests that the error is related to the occurrence of each of my two strings in the STRINGS.TXT file.
Nothing expensive is riding on this; academic only, but I felt that it would be a fitting climax to a chapter on installing and using the command-line processor.
Thanks in advance for any suggestions you are able to make. Please don't spend hours on this.
Cheers, Chris
- Attachments
-
- strings.zip
- (138 Bytes) Downloaded 154 times
-
- Posts: 684
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Find files that do not exist 🤔
The errormessage "Error 8: Everything IPC window not found. Please make sure Everything is running." indicates that ES.exe can't find the right Everything instance (ES passes the query on to Everything, which looks in its database and passes the matching results back to ES).
You might need to specify the Everything instance you want ES to talk to as there can be multiple (named) instances of Everything running.
For example:
TIP: If you don't want to specify the instance every time you want to use ES, you can run the following command (assuming instance 1.5a):
This will save your preference in ES.ini in the ES.exe folder:
ES.ini
You might need to specify the Everything instance you want ES to talk to as there can be multiple (named) instances of Everything running.
For example:
ES.exe -instance 1.5a searchtext.
TIP: If you don't want to specify the instance every time you want to use ES, you can run the following command (assuming instance 1.5a):
Code: Select all
es.exe -instance 1.5a -save-settings
ES.ini
Code: Select all
[ES]
instance=1.5a
-
- Posts: 684
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Find files that do not exist 🤔
Got it!! Thank you NotNull. After I changed the "instance" settings I reran my simple tests (an abbreviated command-line statement) and then reran your example from above.
{{idiot alert}} Strangely the results were unchanged. Nothing came out.{{\\idiot alert}}
Then I thought to add "Mukinbudin" to the strings.txt file (attached) and because I have no files named after a remote wheat bin siding in the Western Australian wheat belt, your statement returned the result (image above) that "I have no files named after a remote wheat bin siding in the Western Australian wheat belt". :clappjng * 6:
Along the way I found that With the instance saved in the Settings, either command will work:- OK. That's enough learning for me today
I still don't fully understand your wonderful 130 characters statement; parts of it, yes, but I shall leave the remainder to another time.
Thanks again!
Chris
-
- Posts: 684
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Find files that do not exist 🤔
Hello david.
I confess that I was intrigued by the subject line.
"What" I thought "is the point of looking for something that isn't there?"
Now I can see that your statement would let one keep track of a project.
For example, if one were writing a User Tutorial for Everything, and wanted to have a chapter (document) on every heading in the wiki, it would be a simple matter to create (as NotNull points out) a Strings.txt that contained each subject, and continually check until one had a document for each subject!
Well Done!
Chris
Re: Find files that do not exist 🤔
Search Functionsdistinct:name
or
unique:name
(/distinct:, should find it [in most browsers, I'd think])
Re: Find files that do not exist 🤔
Oh...
If you saved a listing of all your files to a file, say, xxx
If you saved your 40 names to a file, say 40
grep.exe -w -f 40 xxx > found
(read file 40, searching for wolewords that are found in xxx)
found should then contain names from 40 that ARE found
if you then
diff.exe found 40 > unique
grep.exe ">" unique > uniqueONLY
with that, uniqueONLY should contain a list of your UNIQUE file names
Maybe .
Oh, there are probably a lot of gotchas in this.
And there is also many options to the different commands.
But... something like that may work?
If you saved a listing of all your files to a file, say, xxx
If you saved your 40 names to a file, say 40
grep.exe -w -f 40 xxx > found
(read file 40, searching for wolewords that are found in xxx)
found should then contain names from 40 that ARE found
if you then
diff.exe found 40 > unique
grep.exe ">" unique > uniqueONLY
with that, uniqueONLY should contain a list of your UNIQUE file names
Maybe .
Oh, there are probably a lot of gotchas in this.
And there is also many options to the different commands.
But... something like that may work?
-
- Posts: 684
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Find files that do not exist 🤔
Thanks therube. I don't know how I missed it in my earlier search. It doesn't get much of a mention in Forum Posts.therube wrote: ↑Tue Jul 11, 2023 3:20 pm Search Functions
(/distinct:, should find it [in most browsers, I'd think])
Cheers, Chris