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!!!
Please help mass renaming...
Moderators: Hacker, petermad, Stefan2, white
- Samuel
- Power Member
- Posts: 1930
- Joined: 2003-08-29, 15:44 UTC
- Location: Germany, Brandenburg an der Havel
- Contact:
Open MRT
Search for: (.*)\((\d\d\d\d)\)\s(.*)
Replace by: $2 - $1$3
RegEx: [✓]
See F1 in MRT > RegEx
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)
@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.Samuel wrote:Open MRT
Search for: (.*)\((\d\d\d\d)\)\s(.*)
Replace by: $2 - $1$3
RegEx: [✓]