hello friends,
Greetings to you!
I need to rename MP3 Songs' Title based on following pattern of file-names.
Suppose file-names are of this pattern:
abc - xyz.mp3
now I need to rename title track as:
xyz (abc)
How can I achieve this arduous task (at least for me! )
From FILENAME: ' abc - xyz '
To TITLE : ' xyz (abc) '
Convert "Tag - Tag"
... or ...
Action "Format value"
Field: TITLE
Formatstring: $regexp ( %_filename% , ' ^(.+?) - (.+?)$ ' , ' $2 ($1) ' )
... or ...
Formatstring: $mid ( %_filename% , $add ( $strstr ( %_filename% , ' - ' ) , 3 ) , $len ( %_filename% ) ) ' ( ' $left ( %_filename% , $sub ( $strstr ( %_filename% , ' - ' ) , 1 ) ) ' ) '
... or ...
Action #1 "Format value"
Field: TITLE
Formatstring: $replace ( %_filename% , ' - ' , ' \\\\ ' )
Action #2 "Format value"
Field: TITLE
Formatstring: $meta ( TITLE , 1 ) ' ( ' $meta ( TITLE , 0 ) ' ) '
DD.20160306.1004.CET, DD.20160306.1538.CET
DetlevD:
Convert "Tag - Tag"
... or ...
Action "Format value"
Field: TITLE
Formatstring: $regexp ( %_filename% , ' ^(.+?) - (.+?)$ ' , ' $2 ($1) ' )
From: ' abc - xyz '
To : ' xyz (abc) '
DD.20160306.1004.CET
Thanks a lot.
It worked like a charm. . It's like a magic to me.
But for a beginner like me the expression used in format string is quite intimidating. I am scratching my head thinking that what does these symbols ^ ? $ etc. are doing here in this expression: ^(.+?) - (.+?)$','$2 ($1)'.
Is there any guide/manual on this?
The help? (Press F1)
https://docs.mp3tag.de/actions/replace-regexp
Th ? switches off the greediness.
Thanks a lot. I am trying to go through it.