Multi Rename with Dirs starting with numbers

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
chanlerone
Junior Member
Junior Member
Posts: 4
Joined: 2011-03-06, 07:41 UTC

Multi Rename with Dirs starting with numbers

Post by *chanlerone »

Hi,

I just noticed when having multiple directories starting with numbers and you want to multi-rename the text with all first letters as uppercase, this does not work. It will lowercase everything.
When removing the number in the front the renaming will work.

Cheers!

Sjoerd
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3862
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Well, you are very petty, but you are right.
"Letter" does not mean number and the option says "first letter uppercase".

It is currently implemented as "first character uppercase".
It works the same way with other programs (e.g MS Word)
#5767 Personal license
chanlerone
Junior Member
Junior Member
Posts: 4
Joined: 2011-03-06, 07:41 UTC

Post by *chanlerone »

The problem is this:

having directories like this:

6.8 Test is a test folder

Results in:

6.8 this is a test folder

But I want this:

6.8 This Is A Test Folder
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3862
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

But I want this:

6.8 This Is A Test Folder
In this case just use last option "First of each word uppercase"
#5767 Personal license
chanlerone
Junior Member
Junior Member
Posts: 4
Joined: 2011-03-06, 07:41 UTC

Post by *chanlerone »

And that's just what I am doing... The above explanation is when using that function.
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

This case-change works only for the name-part, not for the extension.

Your name is "6" with an extension of "8 Test is a test folder"

An work around would be
to search for "." and replace with "#"
AND do the case change.
In an second run you can replace the # by an dot again.


Or use an dedicated tool like den4b ReNamer.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3862
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

I tried it with your example and found, that you are caught by the extension trap ;)

You are using a dot within your folder name.
The part of a filename after the last dot is used to be the "extension" ...
... and extensions are not handled by this option.

To overcome this lack, just use a "[E].xxx" in the extension field.
=> This will add a dummy extension to you folder name.
=> the option works on all folder names.

Set option "First of each word uppercase"

Do a rename by pressing "Start!" button
Next press little reload button next to "Start!" button

Set option "Unchanged"
Clear the extension field
=> This will remove the dummy extension

Do a rename by pressing "Start!" button
#5767 Personal license
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3862
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

2Stefan2: This was my first guess, but a "#" or any other replacer may part of a real folder name.
#5767 Personal license
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

2chanlerone

You can rename in one step as follow:
1. search for "." and replace with ">"
2. click on the button beside letter case drop down list and choose "Edit names..."
3. in Notepad search for ">" and replace with ".", save changes and back to rename tool.
User avatar
white
Power Member
Power Member
Posts: 4619
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

2chanlerone
Simply put "[F]" before "[N]" so file name mask becomes "[F][N]".
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

white wrote:2chanlerone
Simply put "[F]" before "[N]" so file name mask becomes "[F][N]".
Genial, just RTFM :lol:

So my script is useless now ;-)

Code: Select all

'*** Script for Script Content Plugin 0.2
'*** http://www.totalcmd.net/plugring/script_wdx.html
'*** http://wincmd.ru/plugring/script_wdx.html
'*** In default var "filename" is the current file incl. full path

' Nach Installation des Plugins im Installationsverzeichnis des Plugins 
' eine Datei namens "CaseChange.vbs" mit folgendem Inhalt anlegen.
'
'Anschließend die script.ini editieren:
 '[Script]
 'Section=CaseChange

 '[CaseChange]
 'LongName=0
 'ParseDirs=1
 'Script=CaseChange.vbs


 'Und zuletzt benutzerdefinierte Spalten anlegen mit Feldinhalt: 
 ' [=script.Result], [=script.Result1], [=script.Result2], ..., [=script.Result9]
 ' Bzw. diese Parameter im MUT (Multi Umbenenn Tool) benutzen

'Test:
'filename = "c:\Python 3.1\Tools\versioncheck\py version check.py"
'filename = "c:\Python31\Tools\version check\6.8 py version check.py"

  FullName = filename
  'msgbox "Current FullName: " & filename
  
  Path = left( filename , InstrRev(filename, "") -1)
  'msgbox "Path: " & path
  
  Parent = mid( path , InStrRev(Path, "") +1)
  'msgbox "Parent folder: " & Parent
  
  Name = mid( filename , InstrRev(filename, "") +1)
  'msgbox "Name: " & Name
  
  If InStr( Name, "." ) Then
    Base = left( Name , InstrRev( Name, ".") - 1 )
    Exte = mid( Name , InstrRev( Name, ".") + 1 )
    'msgbox "Base: " & Base & "  <DOT>  " & Exte
  End If

'// Settings for case change in MRT for 
'// folder name like "6.8 Test is a test folder"
'// where "6" is the "Name" and "8 Test is a test folder" is the extension:
WordArray = split(Exte)

For Each Word In WordArray
    First = left(Word,1)
    First = UCase(First)
    Rest  = mid(Word,2)
    Rest  = LCase(Rest)
    Output = Output & " " & First & Rest
    'msgbox output
Next

Output = trim(Output)
'msgbox Base & "." & Output

'//Give the result(s) back to TC
content  = Base & "." & Output  ' use [=script.Result]  in TC and remove [E] from extension field
content1 = Path                 ' use [=script.Result1] in TC
content2 = Parent               ' use [=script.Result2]
content3 = Name
content4 = Base
content5 = Exte
content6 = ""
content7 = ""
content8 = ""
content9 = ""
chanlerone
Junior Member
Junior Member
Posts: 4
Joined: 2011-03-06, 07:41 UTC

Post by *chanlerone »

Thanks for all the solutions! :D
Not a bug at all, just not really payed attention to the fact that there could be extensions in directory names.

Cheers!
Sjoerd
Post Reply