MultiRenameTool: RegEx Remove parts and change dot to space

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

How I can to distinguish .XXX - part of file name or EXT? In case of folders I can suppose that there is not extensions, but for files .... You suggestions?
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2BullFrog

update: Remove ext from Folders name.

https://yadi.sk/d/-mz8f4GBfmut8
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Ovg wrote:2BullFrog

update: Remove ext from Folders name.

https://yadi.sk/d/-mz8f4GBfmut8
Works perfect, thank you :)
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Umm there is still a bug in there, when the quality is 1080p instead of 720p and there are 4 digitals, the rename will be

From
La.boum.1980.1080p.Anything.Any.Word

To
La boum 1980 (1080)

Any way to fix this? :)
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2BullFrog
Change parameter in call rnm.vbs to

Code: Select all

%F ([^0-9]+)\.(\d{4}).*
e.g.

Code: Select all

TOTALCMD#BAR#DATA
Rnm.vbs
%F ([^0-9]+)\.(\d{4}).*
shell32.dll,115
Rename Files

1
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

It works! Thank you again ! :)
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Found another strange behavior.

Original
Taken.3.2014.READ.NFO.Theatrical.Cut.1080p.BluRay.DTS.x264.HuN-HRT

Renamed
Taken 3 2014 READ NFO Theatrical Cut (1080)


Is this still fixable? :oops:
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2BullFrog
Which name should be in this case?

Taken 3 (2014)?
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2BullFrog

Try

Code: Select all

(\w*\d{0,3})(\d{4}).*
instead of

Code: Select all

([^0-9]+)\.(\d{4}).*
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Yes, it should be Taken 3.
Ovg wrote:2BullFrog

Try

Code: Select all

(\w*\d{0,3})(\d{4}).*
instead of

Code: Select all

([^0-9]+)\.(\d{4}).*
This is the current code, you changed it, because when the quality is 1080p instead of 720p it renamed improperly :

Code: Select all

%F ([^0-9]+)\.(\d{4}).*

When I change it to

Code: Select all

(\w*\d{0,3})(\d{4}).*

I get this error message
Image: http://i.imgur.com/jrbfCgj.png
Line: 7
Character: 1
Code: 800a0009
Error: Index is out of range
Source: Microsoft VBScript runtime error


This is the latest VBS script you made:

Code: Select all

Set objRegExp = CreateObject("VBScript.RegExp")
Set WshArg = WScript.Arguments
Set FSO = CreateObject("Scripting.FileSystemObject")
file_name=""
new_file_name=""
flag=False
objRegExp.Pattern=WshArg.Item(1)
If WshArg.Count>1 Then
  If FSO.FileExists(WshArg.Item(0)) Then
    Set File = FSO.GetFile(WshArg.Item(0))
    set TextStream = File.OpenAsTextStream(1)
    While Not TextStream.AtEndOfStream
      is_File=False
      file_name=TextStream.ReadLine()
      If FSO.FileExists(file_name) Then
        is_File=True
      End If
      If is_File Then
        Set File = FSO.GetFile(file_name)
      Else
        Set File = FSO.GetFolder(file_name)
      End If
      new_file_name=replace(objRegExp.Replace(FSO.GetBaseName(file_name), "$1 ($2)"),"."," ")
      If is_File Then
        new_file_name=new_file_name+"."+FSO.GetExtensionName(file_name)
      End If
      if is_File and not FSO.FileExists(new_file_name) Then
        flag=True
      ElseIf not is_File and not FSO.FolderExists(new_file_name) Then
        flag=True
      End If
      if flag Then
        File.Name=new_file_name
      Else
        msgbox "File/Folder " & new_file_name & " already exist. Can't rename ..."
      End If
    Wend
  End If
End If
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

Sorry, I have read you post incorrectly! :oops:
You call script in a wrong way.
Please give me your button parameters. They should be

Code: Select all

TOTALCMD#BAR#DATA
Rnm.vbs
%F (\w*\d{0,3})(\d{4}).*
shell32.dll,115
Rename Files

1
%F should be the first parameter! You have to change only second parameter.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Ovg wrote:Sorry, I have read you post incorrectly! :oops:
You call script in a wrong way.
Please give me your button parameters. They should be

Code: Select all

TOTALCMD#BAR#DATA
Rnm.vbs
%F (\w*\d{0,3})(\d{4}).*
shell32.dll,115
Rename Files

1
%F should be the first parameter! You have to change only second parameter.
Thank you!
It is working now but making an additional space before the date, is this normal?

Code: Select all

La boum  (1980)
Taken 3  (2014)
Instead of

Code: Select all

La boum (1980)
Taken 3 (2014)
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

BullFrog wrote:is this normal?
I think no :mrgreen:

Code: Select all

TOTALCMD#BAR#DATA
Rnm.vbs
%F (\w*\d{0,3})\.(\d{4}).*
shell32.dll,115
Rename Dirs & Files

1
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Ovg wrote:
BullFrog wrote:is this normal?
I think no :mrgreen:

Code: Select all

TOTALCMD#BAR#DATA
Rnm.vbs
%F (\w*\d{0,3})\.(\d{4}).*
shell32.dll,115
Rename Dirs & Files

1

Ah the perfection! Thank you again :D
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Still love your work! Thank you! :)
Post Reply