functions & modifers to SEARCH for length of filename greater than 6 characters?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
ChrisGreaves
Posts: 609
Joined: Wed Jan 05, 2022 9:29 pm

functions & modifers to SEARCH for length of filename greater than 6 characters?

Post by ChrisGreaves »

The good news is that I believed that I could identify all rogue filenames (not six digits in length) and delete those rogue files.
I have prowled the forum for fifteen minutes and found too many topics to post here.

The bad news is that I still can't get my brain to work.
Untitled.png
Untitled.png (42.12 KiB) Viewed 1609 times
I have constructed a search command

Code: Select all

 t:\images\target\ *.bmp name:len:>11
which I parse as:-
(1) I am interested only in my folder of wallpaper images, specifically the folder “t:\images\target\ ”, with a trailing space as an AND separator.
(2) I am interested only in Windows bitmap files “*.bmp”
(3) I am interested only in the name portion of the full path; not the drive, not the path, and not the extent (for the extent is covered by *.BMP) so “name:”
(4) In particular, I want to know only those files whose name portion is longer than eleven characters “len:>11”

For the record, I am unsure about the name: and len: modifiers, so I have experimented with a len:>6 (in case I should be matching just the characters between the rightmost backslash and the rightmost extent separator), and then tried 7, 10, 11 in case I was mistaken about the name:len: conjunction.
Untitled2.png
Untitled2.png (55.05 KiB) Viewed 1609 times
I know that I can achieve my goal with a series of six wildcard characters (preceded by the NOT operator), so I can get on with my life, but since my life’s goal is to know more about Everything.exe than David knows (HUGE grin) I seek clarification on my use of functions, modifiers, in specifying a search by the NAME portion only, and the LENGTH of each name portion.

In anticipation of instruction: Thank You
Chris
therube
Posts: 4610
Joined: Thu Sep 03, 2009 6:48 pm

Re: functions & modifers to SEARCH for length of filename greater than 6 characters?

Post by therube »

I think this will get it:
ext:bmp filenamelength:>10
.

filenamelength is the length of the filename, including extension (& .).
".bmp" is 4, plus your 6, so > 10.
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: functions & modifers to SEARCH for length of filename greater than 6 characters?

Post by ovg »

it is possible to use stemlength: instead of filenamelength:

Code: Select all

stemlength:>6 ext:bmp
ChrisGreaves
Posts: 609
Joined: Wed Jan 05, 2022 9:29 pm

Re: functions & modifers to SEARCH for length of filename greater than 6 characters?

Post by ChrisGreaves »

@therube and @ovg
Thank you both.
It turns out I just needed to use a bigger hammer, in the sense that I had not mastered all the functions? modifiers? available to me.
filenamelength and stemlength were unknown to me.
I have a long way to go.

Of course I had by now cleaned up my images-folder, so I turned to another folder with coded names - dates really
Untitled2.png
Untitled2.png (22.25 KiB) Viewed 1593 times
filenamelength=11 takes into account what I used to call the Name and the Extent separator and the extent itself.
filenamelength therefore would be useful where I was interested in a consistent extent (as I was in my leading post, and as I am in this response.
Untitled.png
Untitled.png (22.19 KiB) Viewed 1593 times
stemlength=7 takes into account only the part I used to call Name, and I know that users generally use Name to mean one or more of:-
1. The bit after the path but before the extent
2. Everything that follows the path
3. Everything including the drive and folder path

I will now go and read through the pages of syntax to firm up my understanding.

I note in passing that code of the form "length:7" is equivalent to "length:=7". I shall probably settle on using the equals-sign because then it is consistent with the five other relational operators.

Thank you both for your help. I am depressed (grin) that there is still so much to learn, but elated that little by little, the mysteries of Everything become clearer to me.
Cheers, Chris
void
Developer
Posts: 15379
Joined: Fri Oct 16, 2009 11:31 pm

Re: functions & modifers to SEARCH for length of filename greater than 6 characters?

Post by void »

Search modifiers must be applied to the left of your search term.

Please try the following:

Code: Select all

t:\images\target\ *.bmp len:name:>11


The search preprocessor is applied to your search term.

name:len:>11
will expand to:
name:3
(because the length of ">11" is 3)


stemlength=7 takes into account only the part I used to call Name, and I know that users generally use Name to mean one or more of:-
1. The bit after the path but before the extent
2. Everything that follows the path
3. Everything including the drive and folder path
Filename parts in Everything:

Code: Select all

Full Path:	C:\folder\file.txt
Name:		file.txt
Path:		C:\folder
Stem:		file
Extension:	txt

I note in passing that code of the form "length:7" is equivalent to "length:=7". I shall probably settle on using the equals-sign because then it is consistent with the five other relational operators.
There are some subtle differences between:
size:1kb
and
size:=1kb

size:1kb searches for a size between 1 byte and 1024 bytes.
size:=1kb searches for a size that is exactly 1024 bytes.

This range search only occurs when you specify a granularity. (eg: kb)
length:7 and length:=7 will give the same results.

Search Function Syntax
ChrisGreaves
Posts: 609
Joined: Wed Jan 05, 2022 9:29 pm

Re: functions & modifers to SEARCH for length of filename greater than 6 characters?

Post by ChrisGreaves »

void wrote: Fri Dec 16, 2022 9:38 pm name:len:>11
will expand to:
name:3
(because the length of ">11" is 3)
Untitled.png
Untitled.png (25.19 KiB) Viewed 1569 times
Ahah! :oops: I see. In my image above, the length of the string ">111" is 4, and I see now that only <name>s with the character "4" within them are shown. I had missed the expression of names with the character "3" in my earlier expression.
Filename parts in Everything:

Code: Select all

Full Path:	C:\folder\file.txt
Name:		file.txt
Path:		C:\folder
Stem:		file
Extension:	txt
And David, thank you for clarifying this and other features.
As usual, you provide a first-class explanation to a small hurdle I have had with a first-class product.
And then present me with another half-dozen avenues to explore :lol: :D

Thanks again
Chris
Post Reply