Ignore spaces when searching

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
JTCGiants56
Posts: 192
Joined: Fri Nov 28, 2014 3:58 pm

Ignore spaces when searching

Post by JTCGiants56 »

As an example, if there is a file named "Hello John.mp4" and I type in the search "HelloJohn" it will not find the file, only if I type "Hello John". Is there a way to still find the file even if there is spaces in between the search?
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Ignore spaces when searching

Post by therube »

There are no spaces in your search, "hellojohn", so how can it "ignore" them?

If you're not sure if the file name is "hello john" or "hellojohn", why don't you just type hello<space>john (without quotes) as your search & that would find both instances (as well as others - such as: "hello you yellow rabbit named, john, how have you been.mp4").
JTCGiants56
Posts: 192
Joined: Fri Nov 28, 2014 3:58 pm

Re: Ignore spaces when searching

Post by JTCGiants56 »

Misworded my original question, but your way probably makes the most sense. Thanks.
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore spaces when searching

Post by void »

An "Ignore Punctuation" option has been implemented for the next version of Everything, when enabled, this will let you search for hellojohn, which will match hello john

Currently, with Everything 1.4 you will need to use a space to split the search terms up as therube mentions above.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Ignore spaces when searching

Post by therube »

How is that intended to work?

Something like: 'h e l l o j o h n', in that order?
Or in any order?
Or something like x-number of chars is a "sliding window"?
So, "hel" "ell" "llo" "loj" "ojo" "joh" "ohn"?
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore spaces when searching

Post by void »

basically spaces and punctuation are removed from the filename and search before the comparison.

hello john.txt is converted to hellojohntxt

Characters will have to match in the correct order.

"Ignore punctuaction" will be off by default, as I've found searching for punctuaction more useful than ignoring it.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Ignore spaces when searching

Post by therube »

OK, that I understand, that's a simple s/[ '."]//g, kind of thing (& along the same lines as, viewtopic.php?p=21685#p21685).

But is that what the OP is asking, or is he wanting the opposite?
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore spaces when searching

Post by void »

I believe "Ignore punctuation" is what JTCGiants56 wants.

While "Ignore punctuation" ignores spaces, it would also ignore all punctuation. OP might not want this?

OP wants to search for HelloJohn and have it find Hello John.mp4, which is what the upcoming feature "Ignore punctuation" will allow him to do..
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Ignore spaces when searching

Post by therube »

But what I'm not following is if my search is "HelloJohn" how will it know to look for "Hello John" & not "He lloJohn" or "Hellojo hn", or will it find all of them?
Or are the capitalized letters (or similar) intended to demark "words" between which "punctuation" can appear between?
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore spaces when searching

Post by void »

It will find all of them, basically spaces are removed from the search and the filenames.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Ignore spaces when searching

Post by therube »

Ah, OK, I got you now.

So I type in a search
> iwanttosearchforthis
And it finds:
> i want to read 100 books this year, and i want to search for this based on specific criteria
But it does not find:
> i want to read 100 books this year, would you help me search for topics that meet this criteria

So something like
%s/ //g
followed by
x=pos(searchstring, readln)
if x, 'print' readln
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore spaces when searching

Post by void »

Not quite...
> iwanttosearchforthis
And it finds:
> i want to read 100 books this year, and i want to search for this based on specific criteria
Everything will strip the spaces and punctuation from your filename:
iwanttosearchforthis is not found in iwanttoread100booksthisyearandiwanttosearchforthisbasedonspecificcriteria

You would still have to use i*want*to*search*for*this to match your example.
Post Reply