How to Ignore chars in the search (not excluding) ?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
luckulucki
Posts: 65
Joined: Mon Jun 19, 2017 1:45 pm

How to Ignore chars in the search (not excluding) ?

Post by luckulucki »

Hello Friends,

I often paste text from the clipboard to the searchfield in EV.

Unfortunately (and kind of inconvenient too), the pasted text contains some characters not included in the file- or foldernames.
Example

Clipboard:
a) This.is.a.file.name.ext (a simple dot, or https://en.wikipedia.org/wiki/Interpunct)
b) Hello — Filename.ext (ref: https://en.wikipedia.org/wiki/Dash#Em_dash)
c) This_is_a_file_name.ext (ref: https://en.wikipedia.org/wiki/Underscore)
d) ...

Filenames on my Disk:
a) This is a file name.ext
b) Hello - Filename.ext
c) This is a file name.ext
d) ...

I have to manually strip all the dots / underscrores / dashes, etc. to get a result.

Is there any way to automaticly remove / exclude / ignore user defined characters from search?

Thank you very much.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by NotNull »

It is under consideration for a future version of Everything.

For now:

Are you using this for filenames in your browser?
In that case, you can create a browser bookmarklet that will give you a button in your browser.
Selecting some text and pushing that button will open Everything and search for that text without the punctuation characters.

Bookmarklet: link
Installation instructions for Firefox: link

You might have to modify the bookmarklet a little to add extra special characters.
If you are having troubles with that, let us know.


If this is *not* browser related: there is currently no solution for that. You will have to wait for the next major version of Everything (release date unknown as there is still quite some work to do).
luckulucki
Posts: 65
Joined: Mon Jun 19, 2017 1:45 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by luckulucki »

Hello and Thank you!

Thats an interesting approach, going with the good old bookmarklets.
I've used them back in the early 2000, iirc, but it was too much hassle to update them for small changes on the websites and they didn't work across all different browser, I used to use... :-)
NotNull wrote: Sun Jul 21, 2019 1:23 pmIf this is *not* browser related: there is currently no solution for that. You will have to wait for the next major version of Everything (release date unknown as there is still quite some work to do).
I'm using it just "normal", I guess :-)

I see, there is a "Suggestion" board here in the forum.
Should I file in my "request", like opening an issue on github, or can I just reference to this thread?

Thank you.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by NotNull »

I think it is already on the radar. Took me a while to find this thread:
Currently no, you will need to manually remove the unwanted punctuation.

I'm looking at the following solutions for the next major version of Everything:
  • Ctrl + Shift + V to paste without punctuation (punctuation is changed to spaces, eg: gram'ma becomes gram ma)
  • An option to ignore punctuation in the search under the Search menu (searching for gram'ma would match gram'ma or gramma or gram--ma, but not gramfunkma)
  • An option to ignore punctuation in filenames under the Search menu (searching for gramma would match the filename gram'ma)
But there is no harm in posting this as a suggestion too, especially if you have other ideas how to implement this.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by NotNull »

To help you a little, I wrote a little script that when started:
  • Reads what's on the clipboard
  • Replaces special characters with spaces
  • Starts Everything with the new text

Installation
  • Extract the zip
  • Copy Stripper.vbs to - for example - your desktop (explain *that* to everyone ;))
  • Edit the script in Notepad to set the path to Everything. Currently:
    strEverything = "C:\Program Files\Everything\Everything.exe"

    Bonus:
  • create a shortcut to Stripper.vbs on the desktop
  • Give it a keyboard shortcut: Right-click > Properties > Shortcut tab > Shortcut Key = CTRL-ALT-J (for example)

How to use:
  • Copy some text to the clipboard
  • Double-click Stripper.vbs
If you created a keyboard shortcut:
  • Select some text
  • Press CTRL-C
  • Press CRTL-ALT-J
Now Everything will open; searching for the cleaned up text.
Attachments
Stripper.zip
(454 Bytes) Downloaded 592 times
luckulucki
Posts: 65
Joined: Mon Jun 19, 2017 1:45 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by luckulucki »

Excuse my late reply, but THIS IS AMAZING!!! :-)

it worked out of the box with your great explanation.

I'm surely happy now! (Now I can wait peacefully and relaxed for the feature request arrives in EV)

No more to say or ask in this matter.

Thank you!
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by NotNull »

:thumbsup:

Glad that I could help. That you like it makes it even better :D
vanisk
Posts: 152
Joined: Sat Oct 27, 2018 11:33 am

Re: How to Ignore chars in the search (not excluding) ?

Post by vanisk »

OP is happy with Stripper.vbs :lol:, but Option 2 (if anyone else likes)
Using AutoHotKey

My Version

Code: Select all

^+v::
{
	ClipSaved:=ClipboardAll
	Chars_to_Ignore:= [".", "—", "-", "_", "`r`n"]
	For index, value in Chars_to_Ignore
		clipboard:=StrReplace(clipboard, value, " ")
	SendInput {Raw}%clipboard%
	Clipboard:=ClipSaved
}


NotNull's UPDATED version

Code: Select all

^+v::
{
    Chars_to_Ignore:= [".", "—", "-", "_", "`r`n"]
    ClipSaved:=ClipboardAll
    Send, ^c
    ClipWait,1

    For index, value in Chars_to_Ignore {
      clipboard:=StrReplace(clipboard, value, " ")
    }
    Run, "c:\tools\everything\everything.exe" -search "%clipboard%"
    Clipboard:=ClipSaved
}
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by NotNull »

A bit more background about those 2 AutoHotKey options:

The first one is a general paste alternative:
If you put some text on the clipboard (Ctrl-C), you can do a Ctrl-Shift -V in *any* application.
It will then paste the clipboard text without all the special characters (those are replaced by spaces).
After that, the original text (with special characters) is still available to paste elsewhere.

The second one is Everything specific:
Select some text, press keyboard shortcut Ctrl-Shift-V and Everything will open with the selected text (minus special characters).
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to Ignore chars in the search (not excluding) ?

Post by NotNull »

In Everything 1.5 pasting without punctuation is possible using the 'CTRL + SHIFT + V' keyboard shortcut.
(just stumbled upon this old thread and thought it was worth mentioning)


Ignore punctuation
Post Reply