Hi yu'all.
I read the topic Search Preprocessor and the threads Suggestion: Rename "Preprocessor" to "search functions" and Search Preprocessor Suggestions and Search Preprocessor Suggestions and gather that Search Preprocessor is working.
That suggests that I have failed to grasp some basic understanding of Preprocessor functions
I tried the example from the topic Search Preprocessor and although “#upper:"abc 123"” is supposed to search for “ABC”, the result list shows “abc”
Evaluating the search command with a prefix “/” evaluates to upper-case.
In the case of "upper", I figure that I will rarely have a literal string such as "abc", but instead some sort of labeled value to be forced into upper-case.
The search command example (2nd image) show me that "upper" does indeed force upper-case, but trying to force upper case shows entries bolded with the lower-case "abc" and "123".
A basic search "abc" returns 576 objects.
As does the search ":ABC".
WAIT!
I might have worked it out myself: The preprocessor function "upper" is a command that tells Everything "how to behace from now on" and will be applied to every search string I key in after this time (until reset).
Is that closer to the truth?
Thanks for any suggestions. Chris
PS. The laptop arrived yesterday, so I hope to be on the new system by Monday. C.
Beginner fails at “#upper:"abc 123"”
Re: Beginner fails at “#upper:"abc 123"”
Shouldn't you include the preprocessor expression in brackets? Did not use such expressions so far, though.
Like
Like
Code: Select all
[upper:"abc 123"]
-
- Posts: 688
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Beginner fails at “#upper:"abc 123"”
Thanks Michi. Your comments have increased my knowledge (I think) First I tried a literal test, typing my surname with CapsLock ON. This produced the results shown above Then I tried your example, but using my name in lower-case (and adding the missing double-quote: It was hiding on MY keyboard right next to the <Enter> key ) but this didn't work.Michi wrote: ↑Fri Mar 03, 2023 3:31 pm Shouldn't you include the preprocessor expression in brackets? Did not use such expressions so far, though. LikeCode: Select all
[upper:"abc 123"]
So I tried
Code: Select all
case:[upper:"greaves"]
This is starting to make sense.
The construct [upper:"greaves"] causes the pre-processor to replace my string with the result of the processing. That is, my string [upper:"greaves"] is replaced with the string "GREAVES".
So far so good, but now we need to make use of "GREAVES" and so we apply the Search Modifier case:
The search modifier case: tells Everything to look for upper-case versions of "greaves".
The Preprocessor Function(?) tells Everything that I am too lazy to use Caps-Lock,
My mind was locked into the thought "this is a search string" instead of "once this has been pre-processed, it will be a search string".
Cheers, and thanks again.
Chris
Last edited by ChrisGreaves on Tue Mar 07, 2023 1:47 pm, edited 1 time in total.
Re: Beginner fails at “#upper:"abc 123"”
You will unlikely type in [upper:] for a normal search.The Preprocessor Function(?) tells Everything that I am too lazy to use Caps-Lock
The Everything Preprocessor might be useful for setting the search from the command line or filter.
Consider the following filter:
Name: My Uppercase Search
Search: case:<#<upper:search:#>:>
Macro: myupper<search>
Activate the filter and search for greaves
Consider the following myupper.BAT file:
Code: Select all
Everything.exe -s case:[upper:%1]
-
- Posts: 688
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Beginner fails at “#upper:"abc 123"”
Thank you Void; this helps to explain why I struggled to set up an example in a normal search!
I still don't know enough about Everything, and have not (yet) explored macros, so I have bookmarked your response for consumption down the road.
Still and all, thanks for the response.
Cheers, Chris
-
- Posts: 688
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Beginner fails at “#upper:"abc 123"”
I love BATch files! Working backwards, this happens:-
(1) From the DOS CMD.exe window we run the batch file “upper” with the parameter “greaves”
(2) This causes Windows to execute the command
Code: Select all
Everything64.exe -s case:[upper:%1]
(4) The “-s” tells Everything to execute a search.
(5) The %1 has been expanded (by CMD.EXE) to the value of the first parameter to the batch file, hence it is replaced by “greaves”
(6) The square-bracketed term “[upper:greaves]” is processed by the Everything pre-processor and, naturally, evaluates to “GREAVES”
(7) The modifier “case:” tells Everything to enforce case-sensitivity, that is in this example to look only for “GREAVES” all in upper case, not lower-case, not a mixture.
(8) I test this theory by typing in “case:GREAVES” in the search box; the same three files will appear.
(9) Note that in the image above, that search string was NOT typed in by hand. It arrived by virtue of the operations described here by the batch file and the preprocessor.
Exercise (6) Why do we get two different results from”case:GREAVES” and “GREAVES” Because in the second example where we happen to supply an upper-case string, we have not specified that we are interested only in upper-case. In this case Everything finds any mixture of upper- and lower-case alphabetics that satisfies the seven letters provided.
Owzat?
Cheers, Chris