ni.va
December 15, 2011, 7:31pm
1
Hi
I recently discovered how Win7 windows explorer uses Artist field to show Contributing Artists separately. so I formatted the Artist field to Artist separated by "/". Like:
ARTIST: Benny Benassi/Kelis/APL/Jean-Baptiste
& now I want to use this field in file names formatted like: (in tags - filenames Dialog)
Benny Benassi Ft. Kelis, APL & Jean-Baptiste
in my collection there are tracks that have from 1 to 4 contributing artists & I want this to work with all of them as follow:
Artist: A
Output: A
Artist: A/B
Output: A Ft. B
Artist: A/B/C
Output: A Ft. B & C
Artist: A/B/C/D
Output A Ft. B, C & D
Artist: A/B/C/D/E
Output: A Ft. B, C, D & E
Would it be possible Guys??
Thanks
ni.va:
.....& I want this to work with all of them as follow:
Artist: A
Output: A
Artist: A/B
Output: A Ft. B
Artist: A/B/C
Output: A Ft. B & C
Artist: A/B/C/D
Output A Ft. B, C & D
Artist: A/B/C/D/E
Output: A Ft. B, C, D & E
I'm only on my fone atm but I will try and help.
Try this (You have to put these in one single action group for this to work:)
If you want the FILENAME format:
%artist% - %title%
Action #1 (MUST BE TOP ACTION)
Format field: _FILENAME
Format : %artist%
For: Benny Benassi NO ACTION NEEDED
Action #2
For: Benny Benassi/Kelis
Exp: ^(.+)/(.+)$
Replace: $1 Ft. $2
Action #3
For: Benny Benassi/Kelis/APL
Exp: ^(.+)/(.+)/(.+)$
Replace: $1 Ft. $2 & $3
Action #4
For: Benny Benassi/Kelis/APL/Jean-Baptiste
Exp: ^(.+)/(.+)/(.+)/(.+)$
Replace: $1 Ft. $2, $3 & $4
Action #5
For: Benny Benassi/Kelis/APL/Jean-Baptiste
Exp: ^(.+)/(.+)/(.+)/(.+)/(.+)$
Replace: $1 Ft. $2, $3, $4 & $5
Action #6 (MUST BE BOTTOM ACTION)
Format field: _FILENAME
Format : %_filename% - %title%
Test on a small amount of files first.
ni.va
December 17, 2011, 7:55pm
3
Thanks It worked but with some small changes (figured out by looking through Help file)
If you want the FILENAME format:
%artist% - %title%
Action #1 (MUST BE TOP ACTION)
Format field: _FILENAME (I used a costum field ("NEW"))
Format : %artist%
Action #2
Exp: ^([^/] +)/([^/] +)$
Replace: $1 Ft. $2
Action #3
Exp: ^([^/] +)/([^/] +)/([^/] +)$
Replace: $1 Ft. $2 & $3
Action #4
Exp: ^([^/] +)/([^/] +)/([^/] +)/([^/] +)$
Replace: $1 Ft. $2, $3 & $4
Action #5
Exp: ^([^/] +)/([^/] +)/([^/] +)/([^/] +)/([^/] +)$
Replace: $1 Ft. $2, $3, $4 & $5
Action #6 (MUST BE BOTTOM ACTION)
Format field: _FILENAME
Format : %_filename% - %title%
EDIT: Sep 8 2013:
I Actually figured out the better solution.
I edited this post to avoid pumping up an old thread.
So my new solution is:
If you want the FILENAME format:
%artist% - %title%
Action #1 (MUST BE TOP ACTION)
Format field: _FILENAME (I used a costum field ("NEW"))
Format : %artist%
Action #2
Exp: ^([^/]+)/([^/]+)
Replace: $1 Ft. $2
Action #3
Exp: ([^/]+)/([^/]+)$
Replace: $1 & $2
Action #4
Replace:
Original:"/" (Without quotes)
With:", " (Without quotes)
Action #5 (MUST BE BOTTOM ACTION)
Format field: _FILENAME
Format : %_filename% - %title%
And if you used a custom field like me:
Action #6
Remove fields:"new" (Without quotes)
or if you want to have the featuring part after title the Actions 5 & 6 replace with:
Action #5 /1
Guess Values:
Source format: %new%
Guessing pattern: %new% Ft. %ft%
Action #5 /2
Format field: _FILENAME
Format : %new% - %title% (Ft. %ft%)
Action #6
Remove fields:"new;ft" (Without quotes)
Also you can summarize the whole actions into one format string to use in the "tags - filenames" Dialog:
Format String:
$replace($regexp($regexp(%artist%,'^([^/]+)/([^/]+)','$1 Ft. $2'),'([^/]+)/([^/]+)$','$1 & $2'),/,', ') - %title%
Hope this would help somebody...
good to see your getting a grasp of reg exp.
The e.g (.+)/(.+) is basically the same outcome because (.+) searches everything UNTIL it meets '/' so saying find everything exept '/' until '/' reads basically the same.
ni.va
December 18, 2011, 7:17am
5
stevehero:
good to see your getting a grasp of reg exp.
The e.g (.+)/(.+) is basically the same outcome because (.+) searches everything UNTIL it meets '/' so saying find everything exept '/' until '/' reads basically the same.
from what I tried with my files, the e.g (.+)/(.+) matches "A/B/C" taking "A/B" for the first part & "C" for the second.
dano
December 18, 2011, 8:04am
6
It's not the same. (.+)/ searches until the last / char
Here's a good explanation:
Watch Out for The Greediness
As ive said im on me fone so didnt have a chance to test the action first. My bad.