rearranging string

Advanced Renamer forum
#1 : 05/09-17 01:46
Steven Roy Supeene
Steven Roy Supeene
Posts: 4
If I have a string like 'song number' - 'title' - 'artist' and I want to change it to 'artist' - 'title' - 'song number' how do I do it?
I've been able to move the 'song number' to the back using the swap feature but can't figure out how to swap the 'title' and 'artist'


05/09-17 01:46
#2 : 05/09-17 22:08
D.Ach
D.Ach
Posts: 35
Make sure settings has word separator set to space " " (no quotes)
and all methods are set to "name". Be careful to notice spaces 'before, after, between'
input info.

Result: Artist - Title - 01

Swap: " - "
1st

Add: " <word:1> -"
<word:3>

Add: " -"
<word:3>

Replace: "- -"
"-"
1st

Remove: "<word:2>"
"1"

Replace: "- "
empty
1st

...possibly a more efficient way outside of regex, but there it is.


05/09-17 22:08 - edited 05/09-17 22:17
#3 : 06/09-17 05:03
Steven Roy Supeene
Steven Roy Supeene
Posts: 4
Reply to #2:
I tried this but it didn't work.
Maybe I didn't explain myself clearly
I have may zip files with string names like
LBLS03-08 - Black Velvet - Alannah Miles
and I want it to read
Alannah Miles - Black Velvet - LBLS03-08
each string has 3 segments as above but each segment is of different lengths
like, another string would be
LBLS03-13 - Hand In My Pocket - Alanis Morissette

I can swap the first segment LBLS03-08 to the end
or the last segment Alannah Miles to the front
but I can't swap the first segment and the last


06/09-17 05:03
#4 : 06/09-17 08:42
Kim Jensen
Kim Jensen
Administrator
Posts: 880
Reply to #1:
Try this:

Add the replace method and configure it like this:
Text to be replaced: (.+) - (.+) - (.+)
Replace with: \3 - \2 - \1
Use regular expressions: Checked
Apply to: Name

This will not work if the title or artist contains " - ".


06/09-17 08:42
#5 : 06/09-17 09:41
Steven Roy Supeene
Steven Roy Supeene
Posts: 4
Reply to #4:
That worked great!
Thank you so very much


06/09-17 09:41