#1 2021-09-01 14:42

AndrewRH
Member
Registered: 2012-02-20
Posts: 8

Rename the extension only (not in filename)

Is there a way to select just the file extension for a renaming rule?
My goal is to recursively rename all movie files extensions (I need to remove a trailing underscore) - without affecting the filename (most filenames contain one or more underscores).
Some rules have a tick box to skip the file extension but not one to select just the file extension.
Thank you in advance!

(I also sent an email to den4b support for this; and if that person here, then please accept apologies for double-ask!)








Subject adjusted to better fit the content
Original: Rename based on what in extension (not filename)

Offline

#2 2021-09-01 16:31

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Rename the extension only (not in filename)

FROM:
File_name1_test.ext
File_name2_test_.ext_
File_name3_test.ext_
File_name4_test.ext__
File_name5_test.ext___

TO:
File_name1_test.ext
File_name2_test_.ext
File_name3_test.ext
File_name4_test.ext
File_name5_test.ext


TRY:
https://www.den4b.com/wiki/ReNamer:Rules:RegEx
Expression: _+$
Replace:
[_]Skip extension



Explanation:
_+$
_ >> literal sign underscore
+ >> one-or-many of the expression right before (here the underscore)
$ >> match at the very end of the string
[_]Skip extension >> do not skip ext to work on the trailing underscores after the ext too





HTH?


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2021-09-01 18:27

AndrewRH
Member
Registered: 2012-02-20
Posts: 8

Re: Rename the extension only (not in filename)

I'll try that! Thank you!

Offline

#4 2021-09-02 06:12

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Rename the extension only (not in filename)

There is another way:


- add all files

- mark only those with extension "*.ext" plus with something trailing "*.ext*":
Mark by Mask: *.ext*
https://www.den4b.com/wiki/ReNamer:File … rk_submenu


- replace the extension on those files entirely by adding the three letter extension EXT newly:
New extension: ext
https://www.den4b.com/wiki/ReNamer:Rules:Extension





Additionally we could also create a PascalScript for that issue cool smile
There are often more than one way to perform it with ReNamer.

 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB