IPB

Welcome Guest ( Log In | Register )

> Notice!

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.

 
Reply to this topicStart new topic
> Insert Track Number Into Title, Using Actions
Alexi
post 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. dry.gif
Go to the top of the page
 
+Quote Post
Sebastian Mares
post 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.59a



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. dry.gif
*


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.
Go to the top of the page
 
+Quote Post
Alexi
post 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
Go to the top of the page
 
+Quote Post
dano
post Mar 15 2005, 17:12
Post #4


Moderator


Group: Moderators
Posts: 5690
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65a



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))


--------------------
Go to the top of the page
 
+Quote Post
Alexi
post 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".
Go to the top of the page
 
+Quote Post
dano
post Mar 15 2005, 17:46
Post #6


Moderator


Group: Moderators
Posts: 5690
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65a



Ok, I didn't look what $right really does wink.gif
Sp replace
$right(%title%,$sub($strchr(%title%,#),1))
with
$right(%title%,$sub($len(%title%),$strchr(%title%,#)))


--------------------
Go to the top of the page
 
+Quote Post
Alexi
post 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 wink.gif
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!
Go to the top of the page
 
+Quote Post
dano
post Mar 15 2005, 18:19
Post #8


Moderator


Group: Moderators
Posts: 5690
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65a



In Mp3tag, press F1 and you see the Help.
There's a link to the scripting reference.


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st November 2014 - 21:16