#1 2020-12-21 12:35

giulio_splash
Member
Registered: 2020-12-21
Posts: 2

Rename movies with years

Hi, i want to rename my movie collection.

FROM:
Movie.1990.mkv
Movie.1990-fanart.jpg

TO:
Movie (1990).mkv
Movie (1990)-fanart.jpg

Thanks :-)

Last edited by giulio_splash (2020-12-21 18:19)

Offline

#2 2020-12-21 18:19

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: Rename movies with years

If you want to enclose all 4 digit sequences in parentheses, you can use the following Regular Expressions rule:

> Expression: "\b(\d{4})\b(without quotes)
> Replace: "($1)(without quotes)

Note that this particular configuration will also insert parentheses where you already have parentheses. In order to avoid the duplicated parentheses you can either remove them in a separate Replace rule, replacing "((" with "(" and "))" with ")", or use a more complicated Regular Expressions rule as follows:

> Expression: "(\A|[^\(])\b(\d{4})\b([^\)]|\Z)(without quotes)
> Replace: "$1($2)$3(without quotes)

There is a lot more happening to avoid inserting duplicated parentheses.

As to those dots, you can replace them with spaces via the Clean Up rule.

References:
https://www.den4b.com/wiki/ReNamer:Regular_Expressions
https://www.den4b.com/wiki/ReNamer:Rules:CleanUp

Offline

#3 2020-12-21 18:54

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 354

Re: Rename movies with years

Maybe this regex can solve more cases that you have using one rule...

1) Regular Expressions: Replace expression "[.( ]{0,2}\b(\d{4})\b\)?" with " ($1)" (skip extension)

From:

Movie.1990.mkv
Movie.1990-fanart.jpg
Movie 1990.mkv
Movie 1990-fanart.jpg
Movie (1990).mkv
Movie (1990)-fanart.jpg
Movie.(1990).mkv
Movie.(1990)-fanart.jpg

To:

Movie (1990).mkv
Movie (1990)-fanart.jpg
Movie (1990).mkv
Movie (1990)-fanart.jpg
Movie (1990).mkv
Movie (1990)-fanart.jpg
Movie (1990).mkv
Movie (1990)-fanart.jpg


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#4 2020-12-22 23:15

giulio_splash
Member
Registered: 2020-12-21
Posts: 2

Re: Rename movies with years

Thank you very much. Tomorrow i will try it :-)

EDIT: Great! Thanks for support :-)

Last edited by giulio_splash (2020-12-27 22:30)

Offline

Board footer

Powered by FluxBB