Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.
Also make sure you've read the Forum Guidelines before posting in this forum.
![]() ![]() |
Mar 15 2005, 09:56
Post
#1
|
|
|
Member Group: Members Posts: 4 Joined: 15-March 05 Member No.: 1642 Mp3tag Version: 2.29 |
This should be simple but does not work. I would like to insert into the TITLE tag the track number. Currently there is a dummy string "#" in the title tag and I wish to replace it with the actual track number. I'm using the Replace with Regular Expression, where "Field" = "TITLE", "Regular expression" = "#", and "Replace matches with" = "$num(%track%,3)". This returns a value of '000'. I'm expecting the actual value of the track number padded with two zeros. How can I get this to work?
Thanks. |
|
|
|
Mar 15 2005, 11:39
Post
#2
|
|
![]() Moderator Group: Full Members Posts: 2275 Joined: 15-June 03 From: Bad Herrenalb Member No.: 496 Mp3tag Version: 2.55a |
QUOTE (Alexi @ Mar 15 2005, 09:56 AM) This should be simple but does not work. I would like to insert into the TITLE tag the track number. Currently there is a dummy string "#" in the title tag and I wish to replace it with the actual track number. I'm using the Replace with Regular Expression, where "Field" = "TITLE", "Regular expression" = "#", and "Replace matches with" = "$num(%track%,3)". This returns a value of '000'. I'm expecting the actual value of the track number padded with two zeros. How can I get this to work? Thanks. Well, it doesn't work the way you want, AFAIK. If you want to add a track number at the beginning of the title field, simply replace "#" by nothing and add another action which formats values. Use TITLE as field and "$num(%track%,3) %title%" as format string. -------------------- There are 10 types of people in this world: those who understand binary, and those who don't.
|
|
|
|
Mar 15 2005, 15:52
Post
#3
|
|
|
Member Group: Members Posts: 4 Joined: 15-March 05 Member No.: 1642 Mp3tag Version: 2.29 |
QUOTE (Sebastian Mares @ Mar 15 2005, 05:39 AM) Well, it doesn't work the way you want, AFAIK. If you want to add a track number at the beginning of the title field, simply replace "#" by nothing and add another action which formats values. Use TITLE as field and "$num(%track%,3) %title%" as format string. Are you saying I cannot *insert* the track number in the middle of the TITLE string using Mp3tag? Does Mp3tag have an enumerate function which would apply to a selection of files/tags? Something like $enum(x,y), where x=starting value, and y=increment. Also, the ability to create variables which are based on information in tags would be nice. Thanks! This post has been edited by Alexi: Mar 15 2005, 16:24 |
|
|
|
Mar 15 2005, 17:12
Post
#4
|
|
![]() Moderator Group: Moderators Posts: 5525 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
I don't know if I understand this right, but you can try FORMAT VALUE on TITLE with:
$left(%title%,$sub($strchr(%title%,#),1))$num(%track%,3)$right(%title%,$sub($strchr(%title%,#),1)) -------------------- |
|
|
|
Mar 15 2005, 17:35
Post
#5
|
|
|
Member Group: Members Posts: 4 Joined: 15-March 05 Member No.: 1642 Mp3tag Version: 2.29 |
QUOTE (dano @ Mar 15 2005, 11:12 AM) I don't know if I understand this right, but you can try FORMAT VALUE on TITLE with: $left(%title%,$sub($strchr(%title%,#),1))$num(%track%,3)$right(%title%,$sub($strchr(%title%,#),1)) Thanks dano! This is very close. If I start with this title: "Sonata in D Major, K. # -- Allegro" and apply your expression, I get "Sonata in D Major, K. 161Major, K. # -- Allegro". The result should be "Sonata in D Major, K. 161 -- Allegro". |
|
|
|
Mar 15 2005, 17:46
Post
#6
|
|
![]() Moderator Group: Moderators Posts: 5525 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Ok, I didn't look what $right really does
Sp replace $right(%title%,$sub($strchr(%title%,#),1)) with $right(%title%,$sub($len(%title%),$strchr(%title%,#))) -------------------- |
|
|
|
Mar 15 2005, 17:54
Post
#7
|
|
|
Member Group: Members Posts: 4 Joined: 15-March 05 Member No.: 1642 Mp3tag Version: 2.29 |
QUOTE (dano @ Mar 15 2005, 11:46 AM) Ok, I didn't look what $right really does Sp replace $right(%title%,$sub($strchr(%title%,#),1)) with $right(%title%,$sub($len(%title%),$strchr(%title%,#))) dano, This worked beautifully. Brilliant, you saved me much work. Where can I learn more about scripting for Mp3tag? Thanks! |
|
|
|
Mar 15 2005, 18:19
Post
#8
|
|
![]() Moderator Group: Moderators Posts: 5525 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
In Mp3tag, press F1 and you see the Help.
There's a link to the scripting reference. -------------------- |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 23:38 |