Multi Rename with Dirs starting with numbers
Moderators: white, Hacker, petermad, Stefan2
-
- Junior Member
- Posts: 4
- Joined: 2011-03-06, 07:41 UTC
Multi Rename with Dirs starting with numbers
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
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
- sqa_wizard
- Power Member
- Posts: 3868
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
-
- Junior Member
- Posts: 4
- Joined: 2011-03-06, 07:41 UTC
- sqa_wizard
- Power Member
- Posts: 3868
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
-
- Junior Member
- Posts: 4
- Joined: 2011-03-06, 07:41 UTC
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.
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.
- sqa_wizard
- Power Member
- Posts: 3868
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
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
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
- sqa_wizard
- Power Member
- Posts: 3868
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Genial, just RTFMwhite wrote:2chanlerone
Simply put "[F]" before "[N]" so file name mask becomes "[F][N]".
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 = ""
-
- Junior Member
- Posts: 4
- Joined: 2011-03-06, 07:41 UTC