Welcome!

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

SignUp Now!

question for Charles Dye on function fixnames

May
104
2
I have a directory which contains a number of subdirectories, and several of these subdirectories have a name which ends with "%@char[11088]%@char[65039]".

I want to use fixnames to remove those 2 trailing Unicode characters. My problem is that I want to remove them, not replace them, and I can't seem to figure out how to do that. Perhaps I'm missing something obvious here? The default replace winds up as "__" (two underscores), which is acceptable but not exactly what I wanted.

If that can't actually be done using fixnames, then so be it, I can live with that. And let me add that I like your tool, I have used it many times.
 
I don't know about @FIXNAMES, but I imagine you could use @LEFT[-2,...] in an appropriately constructed DO loop, maybe something like this (untested)

Code:
v:\> md foo%@char[11088]%@char[65039]

v:\> do d in /s /a:d * ( if "%@right[2,%d]" == "%@char[11088]%@char[65039]" ren "%d" "%@left[-2,%d]" )
V:\foo⭐️ -> V:\foo
     1 dir renamed
 
From version 0.43, you can use /Q without /R to just delete characters. That said, Vincent's is probably the more elegant approach. Or use %@replace[%@char[11088 65039],,%d] to strip out that particular pair.
 
I just now realized that I posted this in the wrong sub-forum, my apologies for that. And yes, the newer version of your plugin works perfectly for what I wanted to do. I didn't realize that I was 2 years out of date on most of my plugins, I just fixed that.
 
If you want to keep up-to-date on his plugins,
I created a point-and-shoot menu that displays his plugins by date,
and downloaded by simply clicking on the selected plugin desired.
1702216378431.png

Ref: Prospero returns

Joe
 
Back
Top