Space character trimming in Find Files

Things you’d like to miss in the future...
Post Reply
Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Space character trimming in Find Files

Post by Mesh »

v13.80.0111 started to trim leading and trailing spaces in Find Files, saying that it's expected behavior.

I think that's half-right.

If you say that file names that start with spaces are not allowed by the OS in the first place, so it makes sense to trim leading spaces from the Standard search - that's fine and correct.

However, spaces are absolutely allowed elsewhere in the filename, so trimming trailing spaces from the search term is not expected behavior.


If we have the following files:

Theory of Stuff.doc
Thesis for exobiology.doc
Thebes - and other places you'll never go.pdf
The Autobiography of David Hasselhoff.pdf




It's perfectly reasonable to do a search for "the " (without quotes) in order make sure we only catch the file(s) we want, and exclude the others.

It doesn't make sense to add an additional procedure for trailing spaces, because they can be so commonly used in a search. (Also, adding quotes doesn't work anyway).


Trimming leading spaces is fine. But I think trailing spaces should be allowed as normal and not trimmed. It makes sense to leave that as it was.

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Space character trimming in Find Files

Post by LittleBiG »

Mesh wrote:It's perfectly reasonable to do a search for "the " (without quotes) in order make sure we only catch the file(s) we want, and exclude the others.
You also gave the answer what is meaningful in this case and what isn't. If you hadn't written the quotation marks and the comment in brackets, nobody would have understood what you want to search. As it is now, and as you wrote everybody gets by the first look what you wanted to search. By the way, I would have written the search in this way:

Code: Select all

the *
without quotes.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Space character trimming in Find Files

Post by Mesh »

The way you did it would not have been clear in my case because there was no character after the space in the search term. The trailing wildcard character is not needed for the search, as "the " performs exactly the same way with less typing (at least before the trimming was added). :)

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Space character trimming in Find Files

Post by LittleBiG »

My
the *
was an example how to write the search now. Yes, you are right, you need to write one more wildcard now. And in exchange, your search term will be clear and unequivocal, can easily be combined with other search terms and an accidental space here or there won't mess up your query, plus you can search in number type columns without strange behavior because of trailing spaces. Lastly, the current way is the most popular, just think about the LIKE operator. If one already wrote searches somewhere else, there is a high possibility that they will be able to write flawless search terms in XY without examining the help file closely.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Space character trimming in Find Files

Post by Mesh »

This isn't an argument about how to write search terms. Ordinarily, I use RegEx, so if you want unequivocal, it doesn't get more unequivocal than that.

But for quick and common beginning-of-filename searches, the syntax I showed is the fastest, easiest, most natural way to do it. And it no longer works - which is unnecessary, as the reasoning for trimming leading spaces does not apply to trailing spaces.

Post Reply