Configuring Directory and File Formats: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
(Created page with "= Configuring Directory and Filename Formats = When <a href="Ripping%20Tracks%20from%20CDs.htm">ripping</a>, <a href="Converting%20Formats.htm">converting</...")
 
(Blanked the page)
Line 1: Line 1:
= Configuring Directory and Filename Formats =


When &lt;a href="Ripping%20Tracks%20from%20CDs.htm"&gt;ripping&lt;/a&gt;, &lt;a href="Converting%20Formats.htm"&gt;converting&lt;/a&gt;, &lt;a href="Exploring%20Tracks.htm"&gt;synchronizing tracks to a portable device&lt;/a&gt;, &lt;a href="Ripping%20Tracks%20from%20CDs.htm"&gt;saving tracks to the virtual CD&lt;/a&gt;, &lt;a href="Burning%20an%20Audio%20CD.htm"&gt;burning Tracks to a CD&lt;/a&gt;, or &lt;a href="Changing%20Filenames.htm"&gt;auto-organizing tracks&lt;/a&gt;, you can select the format in which the directories and filenames will be created. When &lt;a href="file:///F%7C/Documents%20and%20Settings/Rusty/My%20Documents/Docs/MediaMonkey/Sources/help/htmlhelp/Auto-Tag%20from%20Filename.htm"&gt;auto-tagging from filenames&lt;/a&gt;, you can select what tags will be written based on the Directory/Filename format. This section describes Directory and File masks that allow you to define these formats.
== Concepts ==
Generally, there are 3 elements to configure when choosing a destination format:
#Directory: This is chosen using the directory browser button (e.g. C:\My Music), though in some cases (e.g. for burning a CD) there's no need to choose a directory.
#Directory format: This is chosen using the 'masks' such as
  \&lt;Artist&gt;\&lt;Album&gt;\  . e.g.
C:\My
Music\&lt;Artist&gt;\&lt;Album&gt;\ would result in
C:\My
Music\U2\The Joshua Tree\
#Filename format: This is chosen using the 'masks' such as \&lt;Track #&gt;
  - &lt;Title&gt; . e.g.
C:\My Music\&lt;Artist&gt;\&lt;Album&gt;\&lt;Track
#&gt; - &lt;Title&gt; would result in
C:\My Music\U2\The Joshua Tree\1 -
Where the Streets Have No Name.mp3
Similarly, when using Auto-tag from Filename, 2 elements are configured to read the filename format:
#Directory format: e.g. \&lt;Artist&gt;\&lt;Album&gt;\ would read \My Music\Beatles\White Album\Song.mp3 and set Artist field to 'Beatles', and Album field to 'White Album' 
#Filename format: e.g. \&lt;Artist&gt; - &lt;Title&gt; would read \U2 - God and set Artist field to 'U2' and Title field to 'God' 
== Mask Reference ==
The table below describes most of the commonly used characters and fields in a mask.
&lt;tbody&gt; &lt;/tbody&gt;
{| cellspacing="0" cellpadding="1" border="1" align="Default" width="100%"
|-
| width="15%" | ' ' (space)
| width="80%" | A space in a mask appears as a space in the path/filename
      that is written. Note that spaces automatically disappear in case they are
in the beginning or end of a filename.
|-
| width="15%" | '-'
| width="80%" | A dash in a mask appears as a dash in the path/filename that is written.
|-
| width="15%" | '\'
| width="80%" | A slash following a mask element causes a directory to be created.
|-
| width="15%" | '.\'
| width="80%" | A .\ at the beginning of a mask causes whatever portions
      of the mask that follow to be written in the same directory as the source
    file(s).  For example, a mask of C:\My Music\&lt;Artist&gt;
    - &lt;Title&gt; would write tracks to C:\My Music, but a mask of
    .\&lt;Artist&gt; - &lt;Title&gt; would write the new filenames into the
directories from which the source files originate.
|-
| width="15%" |
| width="80%" |
|-
| width="15%" | &lt;Artist&gt;
| width="80%" | Writes the Artist field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Album&gt;
| width="80%" | Writes the Album field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Title&gt;
| width="80%" | Writes the Title field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Genre&gt;
| width="80%" | Writes the Genre field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Disc#&gt;
| width="80%" | Writes the Disc Number field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Track#&gt;
| width="80%" | Writes the Track Number field to a filename (assuming it is not followed by a '\')
|-
| width="15%" | &lt;Year&gt;
| width="80%" | Writes the Year field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Bitrate&gt;
| width="80%" | Writes the Bitrate field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Album Artist&gt;
| width="80%" | Writes the Album Artist field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;BPM&gt;
| width="80%" | Writes the Beats Per Minute field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Composer&gt;
| width="80%" | Writes the Composer field to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" | &lt;Custom x&gt;
| width="80%" | Writes 1 of the 5 Custom fields to a directory or filename (depending on whether it is followed by a '\')
|-
| width="15%" |
| width="80%" |
|-
| width="15%" | &lt;Skip:x&gt;
| width="80%" | Ignores x characters in the path. Used only for Auto-tag from Filename.
|-
| width="15%" |
| width="80%" |
|-
| width="15%" | $First(&lt;'Field'&gt;,count,skip)
| width="80%" | Limits the number of values for multiple definition
      fields to count, optionally skipping skip values. For instance:
      &lt;Genre&gt; would yield:
    Rock;Pop;Acoustic
    $First(&lt;Genre&gt;) would yield:
    Rock
    $First(&lt;Genre&gt;,2) would yield: Rock;Pop
$First(&lt;Genre&gt;,1,1) would yield: Pop
|-
| width="15%" | &lt;'Field':n&gt;
| width="80%" | Can be used in conjunction with any of the above mask
      elements in order to force  alphabetic fields to a specified
    length or to pad alphanumeric fields.  For instance:
    C:\My Music\&lt;Artist:1&gt;\&lt;Artist&gt;\&lt;Album&gt; -
    &lt;Track #&gt; - &lt;Title&gt; which would yield C:\My Music\A\Abba\Gold
    - 2 - Fernando.mp3 , useful for creating alphabetized directories.
    &lt;Track#:2&gt; would yield 07 (for Track=7), and would yield 153 (for Track 153)
&lt;Year:3&gt; would yield 1940 (for 1940); &lt;Year:2&gt; would yield 40 (this latter example is an exception--numeric fields are not otherwise truncated) <br>
      Note: For text fields, the resultant
    characters start from the left.  For numeric fields, the resultant
    digits start from the right.  If n &gt; the number of characters in the field,
    then the resultant path is padded with spaces or 0's depending on whether
the field is text or numeric.
|-
| width="15%" | &lt;'Field':-n&gt;
| width="80%" | Same as above except that if n &gt; the number of
      characters in the field, then the resultant path is padded with spaces or
    0's (depending on whether the field is text or numeric) from the opposite
side.
|-
| width="15%" | &lt;&lt;a href="mailto:%27Field%27@n"&gt;<font color="#000000">'Field'@n</font>&lt;/a&gt;&gt;
| width="80%" | Creates alphabetical
      directories grouped in sets of x letters.  For example: C:\My
    Music\&lt;&lt;a href="mailto:Artist@3"&gt;<font color="#000000">Artist@3</font>&lt;/a&gt;&gt;\&lt;Title&gt; would create directories with all
Artists beginning with ABC, DEF, GHI, etc.
|-
| $RemovePrefix(string)
|
Removes a prefix from a string. e.g. $RemovePrefix(&lt;Artist&gt;) changes 'The Beatles' -&gt; 'Beatles' . Prefixes are configured in
Tools &gt; Options &gt; Library &gt; Appearance &gt; Ignore prefixes.
|-
| $MovePrefix(string)
|
Moves a prefix to the end of a string. e.g. $RemovePrefix(&lt;Artist&gt;) changes 'The Beatles' -&gt; 'Beatles, The'. Prefixes are configured in Tools &gt; Options &gt; Library &gt;
Appearance &gt; Ignore prefixes.
|-
| $Group(string,integer)
| Groups
the first letter of the string into sets of letters of length specified by (optional) integer parameter. e.g. \$Group(&lt;Artist&gt;,2) for
'U2' would yield \UV (similar to &lt;Artist@2&gt;.
|-
| $Replace(string,what,by)
| Replaces all occurrences in a 'string' of 'what' by 'by'.
|-
| $Left(string,n)
| Returns the left n characters of string.
|-
| $Right(string,n)
| Returns right n characters of string.
|-
| $Mid(string,i,n)
| Returns n characters of string starting with character i
|-
| $Trim(string)
| Returns string with spaces trimmed from the beginning and end of string
|-
| $Upper(string)
| Converts string to uppercase
|-
| $Lower(string)
| Converts string to lowercase
|-
| width="15%" |
| width="80%" |
|-
| width="15%" | &lt;Folder:n&gt;
| width="80%" | This will recreate all folders in a
      source path except for the first 'n' directories.  For
    example: C:\My Music\&lt;Folder:2&gt;\&lt;Title&gt; would create the
    source directory structure (without the first 2 directories in the source
paths), followed by track title.
|-
| width="15%" | &lt;Folder:-n&gt;
| width="80%" | This will recreate only the last n folders in a source
      path.  This is very useful when it is known that the source directory
is homogeneously structured.
|-
| width="15%" | &lt;Playlist&gt;
| width="80%" | Writes the Playlist name for any Playlists that have been
      selected to a folder (assuming it is followed by a '\'). This mask
can only be used for CD Burning and Exporting tracks.
|-
| width="15%" |
| width="80%" |
|-
| width="15%" | &lt;Filename&gt;<br>&lt;Filename:n&gt;
| width="80%" | This recreates the current filename, and can be used with modifiers to force the resultant text to a set length.
|-
| &lt;Type&gt;
| Writes the file type to a directory \My Music\MP3\U2... or \My Music\M4A\U2....
|-
| width="15%" | &lt;Auto Number&gt;<br>&lt;Auto Number:n&gt;
| width="80%" | This creates a sequential number that can be inserted into
      the path. This is especially useful for inserting into the beginning
    of a filename when exporting to a device or burning to a CD and you wish
    for tracks in a playlist to be played in the order of the playlist (rather
    than alphabetical order). By default, 3 digits are used, though this is
configurable.
|-
| width="15%" | &lt;Random&gt;<br>&lt;Random:n&gt;
| width="80%" | This creates a random number that can be inserted in the
      path.  It is most useful for inserting into the beginning of a
    filename when exporting to a device or burning to a CD and you wish to
    ensure that the tracks will be played in random (rather than alphabetic)
    order. By default, 4 digits are used, though this is configurable by
setting n.
|-
| width="15%" | &lt;Path&gt;
| width="80%" | This recreates the same path and filename as the original source file(s).
|-
| width="15%" | &lt;Path:n&gt;
| width="80%" | This recreates the same path and filename as the original source file(s), without the first n folders of the source path.
|-
| width="15%" | &lt;Path:-n&gt;
| width="80%" | This recreates the same path and filename as the original source file(s), without the last n elements of the source path.
|-
| width="15%" |
| width="80%" |
|-
| width="15%" | $if(string + criteria,truevalue,falsevalue)
| width="80%" | This allows masks to be used conditionally. Several examples
      follow:
    To use a mask if 2 fields
    or a field and a string are equal, use '=' . For example, in the
    case of an Album Artist differing from the Artist, you may want both
    to appear in the path:
    --- \&lt;Album Artist&gt; -
    &lt;Album&gt;\&lt;Track#&gt; $If(&lt;Artist&gt;=&lt;Album
    Artist&gt;,,&lt;Artist&gt; -
)&lt;Title&gt;
Similarly, other operators such as &lt;,&lt;=,&gt;,&gt;= and &lt;&gt; can be used. For instance, to return 80's for year 1984:<br> --- $If(&lt;Year&gt;&lt;1990,80's,$If(&lt;Year&gt;&lt;2000,90's,2000's))
To use a mask if a field isn't empty, just enter a string without any criteria'. For example:<br> --- D:\My Music\$If(&lt;Artist&gt;,&lt;Artist:1&gt;,None)\&lt;Artist&gt;$If(&lt;Album&gt;, - &lt;Album&gt;\,)&lt;Title&gt;<br> --- \$If(&lt;Artist&gt;,&lt;Artist&gt; - ,)$If(&lt;Album&gt;,&lt;Album&gt; - ,)$If(&lt;Track#&gt;,&lt;Track#&gt; ,)&lt;Title&gt;
Note: Make sure to precede all control characters such as ')' or ',' with '$' if you wish them to appear as normal characters. For example:<br> --- \My Music\$if(&lt;artist&gt;,&lt;artist&gt; (&lt;year&gt;$),Unknown)\&lt;track&gt;<br>
|-
| $Len(string)
| Returns the length of string. Useful with $If() function.
|-
| $Assign(variable,value) and $Use(variable)
|
Allows variables to be used several times in a mask, e.g. '$Assign(V,A)$Use(V)$Use(V)' produces string 'AA'. This is useful when a complex 'value' (i.e. a mask component) needs to be used several
times within a mask.
|}

Revision as of 22:29, 21 April 2011