Why does search for spaces '* *' not work as expected

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Why does search for spaces '* *' not work as expected

Post by *Sheepdog »

When I search for '* *' I get as result all files. When I search for ' ' I get all files with spaces in the name.

Where does my brain refuse to think like TC???



sheepdog


[edit] I expected that'* *' would find all names with spaces in like the ' ' does.
As I see now a human thinking error. [/edit]
Last edited by Sheepdog on 2004-09-30, 12:43 UTC, edited 1 time in total.
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
nevidimka
Senior Member
Senior Member
Posts: 385
Joined: 2004-06-20, 21:38 UTC

Post by *nevidimka »

When I search for '* *' I get as result all files.
Yep, that's right. An asterisk means all characters, the space is the separator for next search string. Therefore you are looking for all files (1st asterisk) and all files (2nd asterisk).

Solution for your task is a simple space (without asterisk).
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Space in the search criterion

Post by *Clo »

2Sheepdog
:) Hi Stefan !

- What about typing :
* .* (asterisk|space|dot|asterisk) ?
- I tested, I find dirs and files having a space in the name.

:?: Does it the trick ?

:mrgreen:  V G
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
nevidimka
Senior Member
Senior Member
Posts: 385
Joined: 2004-06-20, 21:38 UTC

Re: Space in the search criterion

Post by *nevidimka »

2Clo
Clo wrote:- What about typing :
* .* (asterisk|space|dot|asterisk) ?
- I tested, I find dirs and files having a space in the name.

:?: Does it the trick ?
Obvious not! Did you read/understood the posting before yours?

2Sheepdog
Which behavior do you expect?
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Ahh, space is the separator.

Thx.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
nevidimka
Senior Member
Senior Member
Posts: 385
Joined: 2004-06-20, 21:38 UTC

Post by *nevidimka »

I expected that'* *' would find all names with spaces in like the ' ' does.
If you're looking for names with spaces you have to use quotation marks e.g.
"* *"

We love M$ for introducing spaces in file names, don't we? :D :P
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

We love M$ for introducing spaces in file names, don't we?
INTRODUCING??? M$ was lightyears behind the competition when they finally caught up with the times!
I switched to Linux, bye and thanks for all the fish!
User avatar
nevidimka
Senior Member
Senior Member
Posts: 385
Joined: 2004-06-20, 21:38 UTC

Post by *nevidimka »

INTRODUCING???
Ermmm, which non M$-OS uses spaces in file names? AFAIK X-systems don't allow spaces as a valid character in file names. Therefore we have much trouble if we want to share such M$-standard files via internet. :D :P
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

AFAIK X-systems don't allow spaces
They definitely allow it the same way as you see it in XP. For about at least 20 years now... and it causes just as much trouble ;-)
I switched to Linux, bye and thanks for all the fish!
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

SanskritFritz wrote:They definitely allow it the same way as you see it in XP. For about at least 20 years now... and it causes just as much trouble ;-)
Moreover the X-systems distinguish between lower/uppercase what causes just more troubles.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

Right, that is even more annoying, because on unix everybody just dont use spaces in the file names as a policy, so that mostly dont cause as much problem as this.
I switched to Linux, bye and thanks for all the fish!
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 30-09-2004 14:14:27 +0000 nevidimka wrote:

n> Solution for your task is a simple space (without asterisk).
[^Y]
n> If you're looking for names with spaces you have to use
n> quotation marks e.g.
n> "* *"


Actually the thing is Commander uses not exactly the same logic with different search approaches.

You can quick search directory for names with spaces by '* ' (with one asterisk), but '"* "' (one asterisk with quotation marks) won't work in filters ("Expand selection") or search ("Find Files") - you have to use '"* *"' (two asterisks with quotation marks) for the same purpose.
Well, I understand that one have to use quotation marks in such a strings 'cause "the space is the separator for next search string" but as you can see ' ' (space w/o any quotation marks) works perfectly in "Find Files" dialog, (though you can't save it as filter 'cause "Expand selection" and "Find Files" share saved entries and actually should have the same syntax). But in "Expand selection" ' ' (space w/o any quotation marks) works like a wildcard (and BTW "Expand selection\Specify file type" history dropdown disables after ' ' execution 8\).

BTW, in previous Commander versions one have to use double quotation marks ('""* *""') to search for file names with spaces, so that strange old behavior was fixed but I can't remember Christian announced this fix somewhere 8\.[/face]
Post Reply