IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> %track% in xx/XX format
Frobozz
post Apr 7 2008, 21:55
Post #1


Member


Group: Full Members
Posts: 16
Joined: 13-March 08
Member No.: 6655
Mp3tag Version: 2.41



I'm starting to play with the exports to see what I can do.

Is it standard that the %track% export placeholder always outputs in the format of xx/XX? Where xx is the track number and XX is the total number of tracks.

I was expecting %track% to give me just the track number, but I'm getting it in xx/XX format.
Go to the top of the page
 
+Quote Post
cimnine
post Apr 8 2008, 08:17
Post #2


Member


Group: Full Members
Posts: 40
Joined: 8-July 06
Member No.: 3401
Mp3tag Version: newst



%track% will return you exactly what you enterd as "Track"-tag in the file. So if the value was "12/20" it will return "12/20". And if the value was "12" it will return 12.
br
Chris
Go to the top of the page
 
+Quote Post
dano
post Apr 8 2008, 09:38
Post #3


Moderator


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



Use $num(%track%,2) to get the tracks before '/'


--------------------
Go to the top of the page
 
+Quote Post
Frobozz
post Apr 8 2008, 11:04
Post #4


Member


Group: Full Members
Posts: 16
Joined: 13-March 08
Member No.: 6655
Mp3tag Version: 2.41



QUOTE (cimnine @ Apr 8 2008, 00:17) *
%track% will return you exactly what you enterd as "Track"-tag in the file. So if the value was "12/20" it will return "12/20". And if the value was "12" it will return 12.
br
Chris

I thought that might be how it is. Unfortunately it seems that all of my files are in xx/XX format. They've been ripped using several different ripping tools and all of those tools have done the track tag in the same xx/XX format.

So I can't rely on %track% giving me just the track number and not something in the xx/XX format.

I ended up using a regular expression in the export script to clean up the %track% output.

$regexp(%track%,/.*,)

That strips away the "/" and everything to the right of it and leaves just the track number.

I have MP3Tag exporting an XML format file. Now I'll have to see what I can do with it.
Go to the top of the page
 
+Quote Post
eriken
post Apr 9 2008, 08:51
Post #5


Member


Group: Members
Posts: 4
Joined: 1-April 08
Member No.: 6791
Mp3tag Version: 2.40b



Hi
need some help with $regexp...

now i have track like xx/XX
1/10
2/10
3/10
...
10/10

But i want all with a leading 0, like
01/10
02/10
and also if
01/08 insted of 1/8

if i use
$regexp(%track%,(\d+),0$1)
the i will end up
01/011
011/011
?

Some one that knows these things?!
Go to the top of the page
 
+Quote Post
Frobozz
post Apr 9 2008, 09:58
Post #6


Member


Group: Full Members
Posts: 16
Joined: 13-March 08
Member No.: 6655
Mp3tag Version: 2.41



$num($regexp(%track%,/.*,),2)/$num(%_total%,2)
or
$num(%track%,2)/$num(%_total%,2)

will do that. I only gave them a quick test. You'll want to verify they work with a variety of inputs.

This post has been edited by Frobozz: Apr 9 2008, 10:03
Go to the top of the page
 
+Quote Post
DetlevD
post Apr 9 2008, 10:47
Post #7


Member


Group: Full Members
Posts: 5031
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (Frobozz @ Apr 9 2008, 10:58) *
$num($regexp(%track%,/.*,),2)/$num(%_total%,2)
or
$num(%track%,2)/$num(%_total%,2)

will do that. I only gave them a quick test. You'll want to verify they work with a variety of inputs.

Well, I do it this way:
Begin Actionsgroup Format TRACK 'nn[slash]nn'
Action #1
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: (\d*)\/(\d*)
Replace matches with: $num($1,2)/$num($2,2)
[_] case sensitive comparison
End Actionsgroup Format TRACK 'nn[slash]nn' (1 Action)

DD.20080409.1146.CEST

This post has been edited by DetlevD: Apr 9 2008, 10:48


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
eriken
post Apr 9 2008, 15:53
Post #8


Member


Group: Members
Posts: 4
Joined: 1-April 08
Member No.: 6791
Mp3tag Version: 2.40b



QUOTE (DetlevD @ Apr 9 2008, 11:47) *
Well, I do it this way:
Begin Actionsgroup Format TRACK 'nn[slash]nn'
Action #1
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: (\d*)\/(\d*)
Replace matches with: $num($1,2)/$num($2,2)
[_] case sensitive comparison
End Actionsgroup Format TRACK 'nn[slash]nn' (1 Action)

DD.20080409.1146.CEST


thx! great!
Go to the top of the page
 
+Quote Post
Frobozz
post Apr 10 2008, 09:27
Post #9


Member


Group: Full Members
Posts: 16
Joined: 13-March 08
Member No.: 6655
Mp3tag Version: 2.41



QUOTE (DetlevD @ Apr 9 2008, 02:47) *
Well, I do it this way:

More that one way to skin a cat.
I was assuming he wanted to format the export output rather than changing the actual value in the tags.
Go to the top of the page
 
+Quote Post
eriken
post Apr 10 2008, 09:40
Post #10


Member


Group: Members
Posts: 4
Joined: 1-April 08
Member No.: 6791
Mp3tag Version: 2.40b



QUOTE (Frobozz @ Apr 10 2008, 10:27) *
More that one way to skin a cat.
I was assuming he wanted to format the export output rather than changing the actual value in the tags.

but your was nice to have too! :-)
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: 30th October 2014 - 19:11