find exact match to filename

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

rich@pottruff
New Member
Posts: 8
Joined: 2007 Dec 14, 03:16

find exact match to filename

Post by rich@pottruff »

This thread was originally posted  in the xplorer² Professional forum.        
Moved here 19-May-2010 =fg=
=====================================================


how do i find an exact match to a filename.
i want to search a directory and find all files called a.
no extension.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Welcome to the board, rich@pottruff :)

I think I may not understand the question.
@ find all files called a.
There can be only one file with the unique name a  -- Just type its name and it will be selected.  (Assuming the active pane is the directory you are searching.)  
...But I doubt you mean this trivial case.  ;)

But if you mean to find all files having no file extension, then make a rule that the filename not contain "."
Example:
use Alt+H to access the Show items according to rule dialog.
Leave the Name box blank.
Under Additional Rules, create (Add) a rule for
the Property Name (or for 8.3 Name [S] )
to contain text "."  (without the quotes),  
select the Boolean context = Not
and ok the definition.
Finally, click on Filter, and only files with no extension will be shown.

HTH
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

I suspect he wants to use the find command (Ctrl-F) to find all "a" files (and only a files) in a folder and its subfolders. Since Find adds wildcards automatically this is not a trivial question.

Try this:
in the named field use ?
then create an additional rule using name and in the text field put a

the ? finds all single-character filenames the additional rule just keeps the a's

There really needs to be a simple way to disable the wildcard padding.
Gandolf
Gold Member
Gold Member
Posts: 466
Joined: 2004 Jun 12, 10:47

Post by Gandolf »

FrizzleFry wrote:... There really needs to be a simple way to disable the wildcard padding.
I agree totally, I've more or less abandoned using Find files in x² because I find the padding causes me more trouble than it cures. See an earlier post http://forum.zabkat.com/viewtopic.php?t=40 ... ight=files
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Because rich@pottruff did not indicate an interest in subfolders, I elected to only address what x2 could do in the current folder. :shrug:

I agree that the ability to find exact filename matches for searches in x2 is a missing capability, the addition of which would be welcome.  

... And a logical-to-me way for the user to specify an exact name match would be to surround the search term with double-quotes. (They are prohibited characters in filenames.) Of course this might complicate the text search module which is used on all text attributes, including file contains text.  
... and of course another specification option is simply to have a checkbox, as narayan suggested in the thread referenced by Gandolf, above.
rich@pottruff
New Member
Posts: 8
Joined: 2007 Dec 14, 03:16

Post by rich@pottruff »

hi.
sorry i wasn't clear earlier.
yes i do want to file all files called a (ne ext) in a directory and all sub folders.

i took a look at the earlier post.
i will try the ? and additional rule to limit it to just a.

i had tried searching for just a. but that obviously did not work for me.

i do agree with the earlier post that the auto wildcards are good - i was just looking for a way around it this time.

thanx for your help.
User avatar
nikos
Site Admin
Site Admin
Posts: 15759
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

a revised perhaps easier version than the one suggested by fred, but same in spirit is a Named field like:

a, -*.*

that means find me files called A without the dot (extension)
note that wildcard padding is turned off when you insert the comma character so there's no need to type a?
rich@pottruff
New Member
Posts: 8
Joined: 2007 Dec 14, 03:16

Post by rich@pottruff »

that works nicely.
thanx
Gandolf
Gold Member
Gold Member
Posts: 466
Joined: 2004 Jun 12, 10:47

Post by Gandolf »

nikos wrote:... note that wildcard padding is turned off when you insert the comma character so there's no need to type a?
You're obviously digging up your x² "tips & tricks" information. I just tried "01.jpg,-" (without the quotes) on a directory containing sub-directories and found only 01.jpg files, just what I wanted. Another little gem to add to the secrets of x²!
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

It does seem that using the , (comma) disables wildcard padding in Find.
I had tried a Named field like

a,

but that did not work; however,

a,.

forces a literal search of a and the . (period) does not seem to match anything.

BTW, a? would not work in this case because ? requires a matching character so a? would match a1 or aa but not a
User avatar
nikos
Site Admin
Site Admin
Posts: 15759
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

"a," isn't going to work because x2 is too smart for its own good and realizes that the comma is superfluous :)

but if we want to get really pendantic, a,a would work!
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Post by dunno »

I often need to look for duplicate songs in my music collection, my songs/files within the album/folder are listed as follows,

01 - Yellow Sub
02 - Sun And Sea
03 - Find me Please

is there a way I can search for the name without the number attached, i.e what search string would I use to find duplicates of "Yellow Sub"

Many Thanks
User avatar
nikos
Site Admin
Site Admin
Posts: 15759
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

that would be "yellow sub"
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

@ ... get really pendantic, a,a would work!

Clearly, that trick is the best workaround to achieve an exact match. :thumbup:
And needed just often enough to deserve a mention in the UM, too. ;)
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

nikos wrote:"a," isn't going to work because x2 is too smart for its own good and realizes that the comma is superfluous :)
Actually a, acts like a,* and matches all files.

Both a,. and a,- seem to provide the desired behavior of forcing a literal match of the first search term.

A mention in the manual that , disables wildcard padding and some examples of literal searches would be good.
Post Reply