option to use period (.) as file name separator

Have a suggestion for "Everything"? Please post it here.
Post Reply
nuitlejour
Posts: 3
Joined: Fri Jan 13, 2017 10:19 am

option to use period (.) as file name separator

Post by nuitlejour »

There are many torrent files use period (.) as separator instead of white space, eg:
“Everybody.Loves.Raymond.S01-S09.Complete.720p.WEB-DL.AAC2.0.H.264-BS”
when I search "Everybody.Raymond" no results returned.
Can you add an option to use period as file name separator? or simply ignore special characters (such as . ! # $ - {} () []) in filenames?
Thank you!
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: option to use period (.) as file name separator

Post by void »

A "Match punctuation" search options is on my TODO list, thanks for the suggestion.
a.voider
Posts: 10
Joined: Thu Sep 04, 2014 9:00 pm

Re: option to use period (.) as file name separator

Post by a.voider »

void wrote:A "Match punctuation" search options is on my TODO list, thanks for the suggestion.
Hi, void. Thank you for creating Everything, btw!

I'm also interested in what nuitlejour was asking about. That is perhaps best summarized as an option to ignore all punctuations (i.e. to treat them as spaces); Or maybe just periods & underscores, instead of all punctuation.

There were other people who've asked previously (including me). Some examples,
Option to make [.] equivalent to [space] - voidtools forum
viewtopic.php?f=4&t=4450
Limit to letters and numbers - voidtools forum
http://www.voidtools.com/forum/viewtopi ... tion#p7937
Filter: ignore - voidtools forum
http://www.voidtools.com/forum/viewtopic.php?f=5&t=1758

Any progress on this, void? Thank you!
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: option to use period (.) as file name separator

Post by Stamimail »

I think this kind of problem should be solved by AHK script.
But, if considering solution in Everything, I'm thinking about, SearchFindAndReplace function. like:

Code: Select all

SearchFindAndReplace:<.><*> Everybody.Loves.Raymond.S01-S09.Complete.720p.WEB-DL.AAC2.0.H.264-BS
SearchFindAndReplace:<.|" "><*> Everybody.Loves.Raymond.S01-S09.Complete.720p.WEB-DL.AAC2.0.H.264-BS
SearchFindAndReplace:<720p><720_p> Everybody.Loves.Raymond.S01-S09.Complete.720p.WEB-DL.AAC2.0.H.264-BS
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: option to use period (.) as file name separator

Post by NotNull »

Stamimail wrote:I think this kind of problem should be solved by AHK script.
Or changing the javascript-code of the bookmarklet idea to include a replace([#.]," ") function?
(as I guess this is search text copied from a webpage)

BTW: the original bookmarklet code can be further reduced to:

Code: Select all

 
javascript:location.href='es:'+document.getSelection();
But I am not fluent enough in Javascript to add that replace function myself (I did try, but failed)


BTW2: Just curious: Are there still countries where downloading copyrighted material is legal?
(it used to be in the Netherlands, up until about 4 years ago. Everyone paid some sort of tax to compensate for that, as it was assumed people would download anyway)
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: option to use period (.) as file name separator

Post by therube »

Well the replacement itself seems easy (once you start with someone else's work ;-)), http://jsfiddle.net/b609nr5L/.
But how to incorporate that into the rest of the bookmarklet, now that's beyond me.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: option to use period (.) as file name separator

Post by NotNull »

Got it! (I think ...)

Was working on a PowerShell script where I had to convert some output to text to make things work, when I realized that might be valid for JavaScript too (is JavaScript object-oriented?)
Anyhow, this seems to work:

Code: Select all

javascript:location.href='es:'+document.getSelection().toString().replace(/[\!\#\$\-\{\}\(\)\[\]\)\.\,]/g,' ');
It is probably not needed to escape all these special characters; if you want to optimize this ... be my guest :)
When selecting the string
nuitlejour wrote:ignore special characters (such as . ! # $ - {} () []) in filenames
,
after pressing the bookmarklet toolbar button, this is the searchquery that was sent to Everything:

Code: Select all

ignore special characters  such as                     in filenames
Good enough, as far as I'm concerned :D
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: option to use period (.) as file name separator

Post by therube »

Slight change, appending, ";void(0)":

Code: Select all

javascript:location.href='es:'+document.getSelection().toString().replace(/[\!\#\$\-\{\}\(\)\[\]\)\.\,]/g,'%20');void(0)
That gets rid of the search "displaying" as the "web page" (too, & not that I know what void(0) does ;-)).

And of course you can add your own "filters".

So, add, "_" to ignore:

Code: Select all

javascript:location.href='es:'+document.getSelection().toString().replace(/[\!\#\$\-\{\}\(\)\[\]\)\.\,\_]/g,'%20');void(0)

So, with that...
From here: http://widujfvh.atspace.com/andrew-rosz.htm
If you highlight the string on the web page, "Andrew_Rosz_-_Bobbing_For_Apples.mp3"
It will find both:
Andrew_Rosz_-_Bobbing_For_Apples.mp3
and also:
Andrew Rosz Bobbing For Apples.mp3
One with the dashes (-) & underlines (_) & one without.
The dashes (-) & underlines (_) being filtered out.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: option to use period (.) as file name separator

Post by NotNull »

Didn't notice the first time that this opened a new browser tab. But now it does (?).
Anyway, that void(0) takes care of that (we should ask @void what that void(0) means. If it was void(NotNull), you could ask me :D )
Good teamwork!

Hope this is what @nuitlejour and @a.voider were after ...
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: option to use period (.) as file name separator

Post by NotNull »

I just realized that this could be further simplified by specifying which characters you *don't* want to replace:

Code: Select all

javascript:location.href='es:'+document.getSelection().toString().replace(/[^a-zA-Z0-9]/g,' ');void(0);
replace(/[^a-zA-Z0-9]/g,' ') means: Replace all characters that are NOT in a-z, A-Z or 0-9 with a space.

Although I suspect this goes terribly wrong when you also use non-Latin characters, like Cyrillic, Chinese, Hebrew, ... that you do want to include. But if you;re only using abc, ABC, 123 characters, this will do.


Off-topic: How do these people do that? Do they include unicode ranges? Are there (for example) Chinese punctuation characters/symbols?
So much I don't know ....
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: option to use period (.) as file name separator

Post by therube »

Yes, that's another way to go about it.
Do they include unicode ranges?
That's what I would think.

Code: Select all

; in my terminology
; non-ASCII
regex:[\x{0000}-\x{007f}]
; Arabic
regex:[\x{0600}-\x{06ff}]
; Hebrew
regex:[\x{0591}-\x{05f4}]
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: option to use period (.) as file name separator

Post by NotNull »

therube wrote:Yes, that's another way to go about it.
Turns out that this was not a good idea after all: it also strips characters like à é ü and a lot of others :(
Let's see what an internet-search will bring up (this is probably not the first time that this is an issue ...)
Do they include unicode ranges?
That's what I would think.

Code: Select all

; in my terminology
; non-ASCII
regex:[\x{0000}-\x{007f}]
; Arabic
regex:[\x{0600}-\x{06ff}]
; Hebrew
regex:[\x{0591}-\x{05f4}]
[/quote]
Thanks!
But the more I think about it, the more confusing it gets ... Arabic and Hebrew are right-to-left languages. How do yo specify a regex in that case (as regex works left to right)? How do you even read text that has Arabic and English combined? Your eyes have to jump all over the line. How ...
But this is probably not the right place for questions like that ...
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: option to use period (.) as file name separator

Post by Stamimail »

I made a short movie.
Shift+RightArrow all the way.
https://postimg.cc/image/4wugu7bx3/
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: option to use period (.) as file name separator

Post by NotNull »

Stamimail wrote:I made a short movie.
Shift+RightArrow all the way.
https://postimg.cc/image/4wugu7bx3/
Thank you!!!
That explains a lot.
I guess reading/writing that is somewhat like switching from driving at the left side of the road to driving right (after every corner..). You must stay alert ..

Funny when the first word of a sentence is Hebrew, the text is outlined to the right (makes sense of course, but didn't realize that)
Thanks for the eye-opener!
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: option to use period (.) as file name separator

Post by Stamimail »

Funny when the first word of a sentence is Hebrew, the text is outlined to the right (makes sense of course, but didn't realize that)
What you see is 4 paragraphs.
All paragraphs are LTR, except the 3rd that is RTL (because it is sentence in Hebrew).
It's not made automatically. In Microsoft Word I can determine the writing/reading direction for each paragraph. Typically LTR for English paragraph, and RTL for Hebrew paragraph.
This is usuallly made by:
LTR: LeftCtrl+LeftShift
RTL: RightCtrl+RightShift

No matter what is the writing direction, you can make a mixture of the 2 languages.
As long as the combined text is short (few words), it is (more) readable.
The longer it will be, the harder it will be to read the text.
a.voider
Posts: 10
Joined: Thu Sep 04, 2014 9:00 pm

Re: option to use period (.) as file name separator

Post by a.voider »

therube wrote: Mon Apr 16, 2018 5:23 pm Slight change, appending, ";void(0)":

Code: Select all

javascript:location.href='es:'+document.getSelection().toString().replace(/[\!\#\$\-\{\}\(\)\[\]\)\.\,]/g,'%20');void(0)
That gets rid of the search "displaying" as the "web page" (too, & not that I know what void(0) does ;-)).

And of course you can add your own "filters".

So, add, "_" to ignore:

Code: Select all

javascript:location.href='es:'+document.getSelection().toString().replace(/[\!\#\$\-\{\}\(\)\[\]\)\.\,\_]/g,'%20');void(0)

So, with that...
From here: http://widujfvh.atspace.com/andrew-rosz.htm
If you highlight the string on the web page, "Andrew_Rosz_-_Bobbing_For_Apples.mp3"
It will find both:
Andrew_Rosz_-_Bobbing_For_Apples.mp3
and also:
Andrew Rosz Bobbing For Apples.mp3
One with the dashes (-) & underlines (_) & one without.
The dashes (-) & underlines (_) being filtered out.
Heh, didn't even notice there was a solution posted. Thanks, therube & NotNull. Wish they'd implement this into Everything though. I'd basically have to turn on my Bookmarks bar solely for this.

Could you do a brother a favor and create this bookmarklet?
I need one that will redirect an imdb.com link to another website while keeping a part of the ## part of the link in the new website.
e.g. redirect https://www.imdb.com/title/tt0803096/
to https://www.somesitehere.com/seek.php?movieid=0803096

Please and thank you. :D
Post Reply