gparent wrote:Hi Stefan,
Thanks for your reply.
Your understanding is exactly what I want to do.
O.K., lets try:
Our rules are:
* all your file names are as your examples, one dash only, and no digits.
* Copy a few folders to C:\Temp and use this for first tests of the following.
* In BRU select a few "Name" to see changes on the "New Name"
FROM:
X:\Top 200 songs\001Cat Stevens 1971\Cat Stevens - Wild World.mp3
TO:
X:\Top 200\001 Cat Stevens 1971\Cat Stevens 001-1971 - Wild World.mp3
---------------------------------------
Step 1:
You have:
X:\Top 200 songs\001Cat Stevens 1971\
Cat Stevens - Wild World.mp3
Append Folder Name (9)
Name: Prefix
Sep: #
[Rename]
You get:
X:\Top 200 songs\001Cat Stevens 1971\
001Cat Stevens 1971#Cat Stevens - Wild World.mp3
---------------------------------------
Step 2:
You have:
X:\Top 200 songs\001Cat Stevens 1971\
001Cat Stevens 1971#Cat Stevens - Wild World.mp3
Reset rule (9) to none
RegEx(1)
Match: (.+)#.+-(.+)
Repla: \1 - \2
[Rename]
You get:
X:\Top 200 songs\001Cat Stevens 1971\
001Cat Stevens 1971 - Wild World.mp3
Explanation:
"(...)" are capture groups which holds what is matched by the regex inside of the (...) parentheses, and can be accessed by using \1 -signs.
(.+) -> match one-or-more of any sign till #, so \1 will hold "001Cat Stevens 1971"
#.+- -> match #-sign followed by one-or-more of any sign till an blank followed by an dash, so this will match "#Cat Stevens - "
(.+) -> \2 will hold "Wild World"
At the end we build the new name by using that what is matched by the regex inside the parentheses, and dropping the middle part.
See the two oldest posts in the regex sub-forum for an overview over the regex syntax.
---------------------------------------
Step 3:
You have:
X:\Top 200 songs\001Cat Stevens 1971\
001Cat Stevens 1971 - Wild World.mp3
RegEx(1)
Match: (\d\d\d)(.+) (\d\d\d\d.+)
Repla: \2 \1-\3
[Rename]
You get:
X:\Top 200 songs\001Cat Stevens 1971\
Cat Stevens 001-1971 - Wild World.mp3
Explanation:
(\d\d\d) -> match three digits, so \1 will hold "001"
(.+) -> match one-or-more of any sign till an space followed by four digits, so \2 will hold "Cat Stevens"
(\d\d\d\d.+) -> match an space followed by four digits followed by one-or-more of any sign till the end, so \3 will hold " 1971 - Wild World"
We build our new name by reorder the matches in the replace field: \2 \1 \3
and insert an additional dash between \1 and \3
---------------------------------------
Step 4:
Go to Windows Explorer and
rename
"X:\Top 200 songs"
to
"X:\Top 200"
HTH?
