by Stefan » Tue May 22, 2012 9:52 pm
Swap around "Space-Dash-Space"
e.g.
FROM:
Title - Artist.ext
Song - Artist.ext
Given-name - surname
TO:
Artist - Title.ext
Artist - Song.ext
surname - Given-name
Rule:
There is only exactly ONE pattern " - " in the file name!
(if you have more then one of this pattern, you have to do other things, like temporary replace
one pattern with an un-common sign, or modify the RegEx )
Do:
* test this solution first with COPIES of your real files!
* select a few or all files in "Name"-column to see the preview in "NewName"-column.
* if all went fine, press at [Rename]
USE:
RegEx(1)
Search: (.+)( - )(.+)
Replac: \3\2\1
[ ] Include Ext. un-checked
Explanation:
* Note: this RegEx will only work as expected on files like the above examples.
(.+)( - )(.+) ===> match: (one-or-more of any sign) till (space dash space) followed by (one-or-more of any sign)
\3\2\1 =======> replace with what is matched inside third (...), then second (...), then first (...)
Read more:
- read the help about regular expression
- search the forum for more of this examples
- read the sticky top post of this RegEx-Forum: "Getting help with Regular Expressions
- read the two very first posts of this RegEx-Forum (at the last page now):
- - - Getting Started - Overview over the RegEx syntax (Regular expressions, regexes. RegExp, RE)
- - - Go ahead - Some interesting sides about reg ex,
HTH?