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

User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

I love this community the way folks support each other by coming up with creative solutions for problems.  :D
And thanks to Frizz's further probing, I quickly have a new 'best' workaround for exact matching:  exactfilename,-
I like it best because you don't need to type the filename twice, and I can remember that adding the negation operator "-" by itself cancels the *padding*.

And of course thanks to rich@pottruff for asking the question that started this thread. :thumbup:
narayan
Platinum Member
Platinum Member
Posts: 1430
Joined: 2002 Jun 04, 07:01

Post by narayan »

The User Manual (p.333) does mention that in case of comma-separated entries, individual entries are NOT padded with asterisks.

In fact, it is the comma that cancels the padding, not the "-" (the negation operator). Try anything that you are sure NOT to find in the pane (such as a single letter or a nonsensical word) in place of -. You will again get the same result!

In other words, Fred's formula (exactFileName,-) will of course work reliably; but that's not the unique solution.

I will add in UM how to search for an exact name (and nothing more).

BTW I was the first to suggest that the GUI should have a check box to suppress the padding with asterisks. I still think that's a good idea.

I had also mentioned that the rules are not consistent for single entry and multiple (comma-separated) entries. That's why the user has to manipulate like this. (Converse to the present question, the user has to manually pad each comma-separated entry.)

A check box would greatly simplify things. Then the user has to use the asterisk only if he wants to pad the entry only on one side (only in the beginning/end, but not both).
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Of course "exactFileName,-" is not the only way.
However, as it was pointed out earlier in the thread, something (anything) is required after the comma, else the search tool is 'smart enough' to ignore the comma.

My quirky preference for
"exactFileName,-"  over the other candidates is not only because nothing else is shorter, but also because the "-" reminds me that the * padding is removed (I did not mean to imply that the "-" causes it).

And, of course, I agree that the most obvious, most intuitive, least confusing suggestion is the check box as you originally suggested, narayan.  All the other tricks are just workarounds.
narayan
Platinum Member
Platinum Member
Posts: 1430
Joined: 2002 Jun 04, 07:01

Post by narayan »

Yes of course. I forgot to mention that although other (infinite) possible combinations exist, the - has two advantages over others:
:thumbup:
(a) it is the shortest possible entry (and I love less keystrokes ;) )
(b) the user does not have to think of a nonsensical word each time.
   (If the word is not nonsensical enough, x2 will go find it! )
Gandolf
Gold Member
Gold Member
Posts: 466
Joined: 2004 Jun 12, 10:47

Post by Gandolf »

Support for the checkbox idea also. I think it should be sticky between sessions or can be preset (options or registry, doesn't matter to me) so that it always opens in the same state.

On the subject of the shortest possible entry, I found ",." works and the keys are next to each other, although I agree that ",-" is a better indication that the padding is removed.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

@ ",-"
No, your way (,.) is the better, Gandolf, because of being adjacent keys :D plus, there's a nice mnemonic for that, too.
as in "I want this, period."  8)
Gandolf
Gold Member
Gold Member
Posts: 466
Joined: 2004 Jun 12, 10:47

Post by Gandolf »

I like it! I'd never thought of the mnemonic.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

earlier in this thread Gandolf wrote:I've more or less abandoned using Find files in x² because I find the padding causes me more trouble than it cures.
So does this mean you can now find your more or less abandoned child? ;)
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

While term,. and term,- are simple and convenient ways to force literal searching (disable wildcard padding), I agree with narayan that a checkbox similar to the ones available for the "containing text" field would be a better and more straghtforward solution.

I would also like to have an RE checkbox for the named field.
narayan
Platinum Member
Platinum Member
Posts: 1430
Joined: 2002 Jun 04, 07:01

Post by narayan »

"I want this, period."
 Fred, I just love this mnemonic: It justifies even the comma! :)

And less trouble for the fingers too!
OK this one goes in the UM.

But nikos, the check box (with session-to-session persistence) is still a better thing.

In fact, it should work even in case of comma-separated entries (when selected, it should pad each of them).

And yes, the RE for the Name field is also an excellent idea.
Gandolf
Gold Member
Gold Member
Posts: 466
Joined: 2004 Jun 12, 10:47

Post by Gandolf »

fgagnon wrote:
earlier in this thread Gandolf wrote:I've more or less abandoned using Find files in x² because I find the padding causes me more trouble than it cures.
So does this mean you can now find your more or less abandoned child? ;)
Very much so. It just goes to show how useful discussions like this can be because different ideas are put forward.

I will still need to use FileLocator because one of my requirements is to search for text in files, and have that text displayed so I can copy and paste it. However, normal finding of files is now very much back with x², thanks to the suggestions.
User avatar
nikos
Site Admin
Site Admin
Posts: 15759
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

one of my requirements is to search for text in files, and have that text displayed so I can copy and paste it
you know that xplorer2 can show located text in the quick previewer (?)
have a look at this demo: www.zabkat.com/tour/find.htm
Gandolf
Gold Member
Gold Member
Posts: 466
Joined: 2004 Jun 12, 10:47

Post by Gandolf »

Yes, but it only highlights the word I'm searching for. FileLocator displays the searched text and a (specified) number of lines before / after, for all the files searched. I can then copy and paste this text (for all the files), which is what I want to do.
narayan
Platinum Member
Platinum Member
Posts: 1430
Joined: 2002 Jun 04, 07:01

Post by narayan »

This grep function is available in some freeware applications also.

Check out prgrep.
CAUTION!
There are two websites hosting this application:
http://patrick.renaud.free.fr/tools/prg ... hp?lang=en
http://www.prgrep.com

The freeware host sites (e.g. nonags) have links to the former.
The latter could be a fake!

Others: vgrep, Inforapid, replacem...
Gandolf
Gold Member
Gold Member
Posts: 466
Joined: 2004 Jun 12, 10:47

Post by Gandolf »

Thanks for the link narayan, it looks an interesting program. I'll investigate the site more, should be fun since my French is very rusty!!
Post Reply