ZTree.com  | ZEN  | About...  

 Index   Back

Possible solution   [Discuss]

By: Juergen Hestermann       
Date: Jun 18,2002 at 18:02
In Response to: Not easy... (Slobodan Vujnovic)

I would suggest another syntax which would serve all needs and still is simple enough (I think). We could have up to two (or more?) different F&R strings that are preceeded by modifiers (or they may follow. One or the other, it doesn't matter) as in:

modifier1"oldstring1"newstring1" modifier2"oldstring2"newstring2"

or

"oldstring1"newstring1"modifier1 "oldstring2"newstring2"modifier2

Spaces are only valid in oldstring and newstring. They may be used to separate the first from the second F&R string and they are ignored between modifers. The second F&R string may be omitted and the modifiers too as in:

"oldstring"newstring"

which then only replaces in the name part.
This would have the following advantages:

*) Kim's routine would identify F&R easily by just checking whether *any* "-character is in the string.
*) By using the appropiate modifiers we could use the F&R on the name or extension part only, on both with different strings *and* on both using the same string considering the name as a whole including the most right period allowing to change *all* periods to something else.
*) It stays easy cause in the default case without a modifier [N]ame would be used.
*) Two replacements could be done in one pass even in the name part (in order of arrangement).
*) It can easily be extended with future needs by adding modifiers

Modifiers (case does not matter):
N: Replace in name only
E: Replace in extension only
B: Replace in the whole file name (no extension separated)
W: Replace only 'word' ocurrences
U: Search case sensitive

Examples:

"."_"
replaces all periods in the name part (but not the most right one) with an underscore.

e"doc"bak"
replaces all doc extensions with bak.

"."_" e"doc"bak"
combines the both from above

b"."_"
replaces all periods in the whole name (including the most right one) with an underscore.

--------------------------------------
Comments to your answers:

> 3. If string, what character should be chosen to indicate and delimit the F&R
> operation?
> \, because of readability, but, as you indicated, it may come handy for some
> future function discussed in the past. Does not matter really for us, but
> must be chosen carefully so not to break the grand order of UI rules and
> keystrokes :-)

I have in mind that in some future we may get a taggable flat directory list where the same rename function can be used so the backslash may become a bit confusing because it separates directories in a path. I would prefer the ".

> 5. If string and closed, how many delimiting characters should be permitted or
> required?
> 3, I'm for the \name1.ext1\name2.ext2\[modifiers] syntax

In this case we need two characters for F&R: One to specify F&R (the backslash) and one to separate name and extension (the period). If you want to replace the period it is getting confusing. But as you said, the letter doesn't matter that much for us.

Jürgen.

1,940 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 68 users online (0 registered, 68 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 4:42 am UTC  |  Hits:62,392,631  (7,417 Today )
RSS Feed