Converting year to (year)

Advanced Renamer forum
#1 : 28/01-13 16:06
Dakhor
Dakhor
Posts: 3
Hi

I was wondering if its possible to parse a filename to find the first 4 number combination ie a year in format YXXX where Y is either 1 or 2 and X is 0-9 and then insert a "(" before Y and a ")" after the last number, X number 3. And if no such string is found skip to next file.

Its this or renaming 1000 movies by hand.

Best regards

Dac


28/01-13 16:06
#2 : 28/01-13 21:07
Dakhor
Dakhor
Posts: 3
Reply to #1:

I suppose 2 problems could be

1 - where there already is an "(" before and or an ")" after - ie if before -> skip to next file

2 - Disregard the secuence 1080 as in 1080p

I will have a look if I can figure out how to script this myself

/Dac



28/01-13 21:07
#3 : 28/01-13 22:49
Kim Jensen
Kim Jensen
Administrator
Posts: 771
Reply to #1:
To put ( and ) around years in file names you can use the Replace method and configure it like this:

Text to be replaced: ([12]\d{3})
Replace with: (\1)
Use regular expressions: Checked
Apply to: Name


28/01-13 22:49
#4 : 30/01-13 11:43
Dakhor
Dakhor
Posts: 3
Reply to #3:


It worked - just included occurence 1rst to not parse 1080p into brackets.

Other than that I only had to unmark files that already had () but that took mere minutes.

Awesome program - very powerful and thanx so very much for the help.

/Dac


30/01-13 11:43