By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

A problem with the SafeChars Plugin...


Thank you for taking the time to do that!!! However, two points:
...sorry to report that your version doesn't correctly unquote the test string that I indicated in my previous post. It works fine with more standard strings, but commas and possibly other characters confuse your version.
In the case of commas the above statement is simply not true: Example (from my previous e-mail):
:: 2: Extraneous white space and commas and an invalid character enclosed in double quotes
     when invoking @UnSafeQuote
Before UnSafeQuoting: "A    string    with  extraneous  white  space, commas, & an invalid character enclosed in double quotes"
 After UnSafeQuoting: A    string    with  extraneous  white  space, commas, & an invalid character enclosed in double quotes
There are commas in the above string, and they are handled correctly. This is simply because the batch file has "UnSafe /E:, >NUL:" at the top (and "UnSafe /R >NUL:" at the bottom), and I would assume that the solution that I used for commas would work for any other "problem" characters, although I'm not actually aware of any others that would cause a problem in the first place because, among other things, they are characters that have never caused a problem up to now and I'm not going to take the time (I am very slow) to find out if there actually are any other characters because if another character were to "pop up" (something I actually consider to be quite unlikely), "extending" the "UnSafe /E:, >NUL:" command to include those extra characters would be quite trivial, of course, probably taking less than five minutes to do (even for me!).

So I really don't care if my function is the absolutely "best" solution because I know, for an absolute fact after extensive testing (I only included the "high points" in my original posting on the matter), that my function works and that if I forget it I will have enough information to find it where I have previously used it; real-world example:
[Z:\](Find /I "unsafe" *.btm & For /D /R . %D in (*) Do (For %F in  ("%D\*.btm") do
 (Find /I "unsafe" "%F"))) | List
| List
and results of same (considerably "cut down from the "reality"):
---------- 7ZA.BTM

UnSafe /E:, >NUL:
UnSafe /Z >NUL:




UnSafe /E:, >NUL:
   UnSafe /Z >NUL:


---------- BURNDVDFROMFILELIST.V2012-01-01-02-19.BTM
   UnSafe /E:, >NUL:
   UnSafe /Z >NUL:


UnSafe /E:, >NUL
   UnSafe /Z >NUL:
   UnSafe /Z >NUL:

---------- CONSOLIDATE7ZFILELISTING.V2011-12-21-01-03.BTM
UnSafe /E:, >NUL
   UnSafe /Z >NUL:
   UnSafe /Z >NUL:

---------- Z:\DOIT\DOIT.BTM
UnSafe >NUL: /E,
   UnSafe >NUL: /Z

---------- Z:\DOIT\DOIT.V2011-10-20-12-57.BTM

---------- Z:\DOIT\DOIT.V2011-10-20-21-09.BTM

---------- Z:\DOIT\DOIT.V2011-10-21.BTM

UnSafe /E:, >NUL:
UnSafe /R >NUL:

UnSafe /E:, >NUL:
UnSafe /R >NUL:

Notice that the above searches for a string in both the current directory and its subdirectories, so that's not a problem; and since I do all of my "development" on my Z: drive (a RAM disk), speed is not at all an issue either (the above probably took 30 seconds to do including the time it took me enter the command in the first place). (And if there's a "better" way to do it ("FFind", for example, which I know absolutely nothing about) I really couldn't care less because cutting something down from 30 seconds to 10 seconds is not enough of an improvement - in fact, at 30 seconds there is absolutely nothing that could be enough of an improvement) for me try to take the time to try to "learn" it!) I will also add the I have a batch file that I can use in a "pipe" that will entirely eliminate those files whose names contain "version" information of some kind (".V20yy-mm-dd", *-1.btm, *-2.btm, *+1.btm, etc. etc. etc.) if that is what I want (I almost never do want that in this situation).

And I actually "automated" the above "procedure" some time ago, but since I probably do it a dozen times or more in the typical day because I am so absolutely dependent on "how did I do that last time?" for what I want to do now that I really no longer have to really even "think" about how to do the above so I find it just as quick to do it by hand (I may have mentioned this before, but in the (now somewhat distant, I suppose) past I was a very fast typist, and I ain't all that slow now). And I will add that remembering something as simple and uncomplicated and straightforward as the above is not at issue; while my memory is certainly bad, "concepts" "stick around" longer than "facts"; and with sufficient repetition (as I said, probably a dozen or more times in a typical day) even I can remember almost anything.

As far as the regular expression is concerned, I have no doubt whatsoever that that is a good solution for you, but for me it is simply not. This is because, due to my often previously mentioned bad memory issues, learning something "new" is just on the edge of being impossible (and I have a multitude of strategies that help me; I don't actually have to remember beforehand that there is "something about that" because I know how to quickly find a previously-documented solution to a past occurrence of the "that" if it occurs (and if this is not the first time that "that" has happened, of course; but I religiously document everything of this nature) and therefore apply the previously-documented solution and "remove" the problem. Whole process probably take me less than 5 minutes; including the "fix" since I can, of course, use copy and paste.

So the bottom line is that a "good" solution that I can remember based on knowing what to look for and how to find is far better than a (slightly!) better one where that is not the case.

And I'm not at all trying to discourage you (or anyone else for that matter) from suggesting ideas of this nature; if I do, in fact, find them to be substantially better than what I am currently doing I will incorporate them (again, that is not the case for your "solution" pretty much completely because of my bad memory and the fact that the syntax of the regular expression is not trivial (for me!); whereas my function, in my opinion, is); and other people looking at this bulletin board may find them useful even if I do not so they are probably worth it on that basis alone. (I don't know if you've ever noticed, but the number of people who a least look at these things is pretty amazing.)

And, finally, I really do appreciate the fact that you took the time to enter those postings! Thank you, again!!!! :)

- Dan

Similar threads