Please help mass renaming...

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
mika
Junior Member
Junior Member
Posts: 15
Joined: 2007-01-03, 22:04 UTC

Please help mass renaming...

Post by *mika »

I need to rename a bunch of files with different extensions. Basically, there is year in the brackets somewhere inside the file name, and I need to move the year to the beginning of the file name, something like this:

File1 (1994) Description ABC.doc -> 1994 - File1 Description ABC.doc
File123 (2001) Description DEFG.txt -> 2001 - File123 Description DEFG.txt

and so on.

I hope there is a quick way to do it. Please help!!!
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Open MRT
Search for: (.*)\((\d\d\d\d)\)\s(.*)
Replace by: $2 - $1$3
RegEx: [✓]

See F1 in MRT > RegEx

Code: Select all

(.*)       > stands for many characters; can be referenced by $1 (because of the brackets around it)
\(         > stands for "("
(\d\d\d\d) > stands for 4 digits; can be referenced by $2 (because of the brackets around it)
\)         > stands for ")"
\s         > stands for whitespace like a space " "
(.*)       > stands for many characters; can be referenced by $3 (because of the brackets around it)
risk
Junior Member
Junior Member
Posts: 87
Joined: 2007-07-30, 03:18 UTC

Post by *risk »

Samuel wrote:Open MRT
Search for: (.*)\((\d\d\d\d)\)\s(.*)
Replace by: $2 - $1$3
RegEx: [✓]
@Samuel, I always wanted to put in the time to learn RegEx because it can be useful in many tools including TC. Seeing how you search and replace strings in the way that would be impossible to do with out it, you've now inspired me to finally commit do it. Thanks.
User avatar
ehab
Senior Member
Senior Member
Posts: 271
Joined: 2007-10-29, 07:41 UTC
Location: Libya

Post by *ehab »

if you wanna learn regex i recommend regexbuddy YEs it costs money but its worth it.
#181344 Personal licence
mika
Junior Member
Junior Member
Posts: 15
Joined: 2007-01-03, 22:04 UTC

Post by *mika »

Samuel:

It works!!!

Thank you very much for your help!!!!!!!!!!
Post Reply