Help - Search - Members - Calendar
Full Version: create a filename with optional portions
Mp3tag Forums > Mp3tag - International > Support
Prorok Rak
Hi, I would like to rename my files according to this scheme:

  • If there is not track number, I want my filename like this:
    Artist - Title
  • If there is track number then the name should follow this schme:
    (track) Artist - Title


I tried to use this action, but it doesn't work. What am I doing wrong?
$validate($if($isdigit(%track%),'('$num(%track%)') ',2),)%artist% - %title%,_)
ohrenkino
ZITAT(Prorok Rak @ Mar 21 2012, 16:03) *
If there is not track number...

You could use the converter Tag-Filename and the mask
[(%track%) ]%artist% - %title%
The square brackets enclose the optional part
Prorok Rak
Unbelievable. Who would say it's so easy.
Thank you.
pone
If it is crucial for your naming filenames, that %track% has to be a number, this is the optional %track% part like you wanted it in the first way:

$if($isdigit(%track%),'('$num(%track%,2)')' ,)
ra7h35m20s
Not sure how much detail you want in your filenames but this is how I like my filenames....

If I have multi disc sets then I append the discnumber as in the format below. Inversely, no multi disc just %track% %title%

%discnumber%-%track% %title%

For example:

The Album "Days of Rising Doom" from AINA. Disc 2, Track 2 would look like this:

2-17 The Beast Within

(I also number all tracks sequentially from 1 - number of tracks ... this seems to make it easier for some apps in the sorting process I have found)

I suppose the mechanics of it may be a bit confusing. But if you have the field %totaldiscs% or an equivalent this will work in your action group ...

Action:Format Value
1. Field: _FILENAME
2. Format String: $ifgreater(%totaldiscs%,1,$left(%discnumber%,2)-$num(%track%,2) %title%,$num(%track%,2) %title%)

Hope this helps you....
DetlevD
QUOTE (Prorok Rak @ Mar 21 2012, 17:03) *
Hi, I would like to rename my files according to this scheme:
  • If there is not track number, I want my filename like this:
    Artist - Title
  • If there is track number then the name should follow this schme:
    (track) Artist - Title

Try this format string expression with an action of your choice ...
$if(%TRACK%,'('$num(%TRACK%,2)'',%DUMMY%)%ARTIST%' - '%TITLE%)

If you want to prepend the running disc number, then try this expression ...
$ifgreater(%TOTALDISCS%,1,$num(%DISCNUMBER%,1)'-',%DUMMY%)$if(%TRACK%,'('$num(%TRACK%,2)'',%DUMMY%)%ARTIST%' - '%TITLE%)

DD.20120436.0636.CEST
Prorok Rak
Thank you all for your tips.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.