Template file format
~~~~~~~~~~~~~~~~~~~~

Author: Luu Tran
Last revision: 30 Jan 1998.

Starting with version 0.9.3, Clarion allows you to export its play lists to any text file format.  You just need to write the appropriate template file.  I have provided two sample templates for comma separated values (CSV) files and HTML files.  CSV files can be read by spreadsheet and database programs such as Excel or Access.  HTML files can be read by any web browser.  This document describes the format for the template files themselves.

First, the template file should be a plain ASCII (text) file.  It should be name as file-format-extension.tem.  For example, the template for html files should be named html.tem, or if you prefer, htm.tem.  Files exported using the template would then have the extension .html or .htm, respectively.

You may format the file however you want the output file to look like, i.e., text, spaces, blank lines will be written exactly as they appear in the template file.  Clarion will substitute the following special tokens with their respective values as follow:


Token                Value

%playlist%           Name of the play list
%playlistlong%       Name of the play list with full drive / path
%totallength%        Total length of play list in hh:mm:ss
%count%              Number of songs in play list
%date%               Date file was generated
%version%            Version of Clarion being used.

Note: a) these tokens are CASE SENSITIVE; b) they cannot be broken up between lines.  That is, 

%play
list%

has no special meaning.


In addition, the special token .data. marks the beginning and end of a block whose content is duplicated for each item in the play list.  That is, given

.data.
(some stuff
goes in here)
.data.


Clarion will remove the lines .data. and writes out 

(some stuff
goes in here)

for every song in the play list.  Important: .data. must appear on a line by itself and has no leading and trailing spaces.

Inside the .data. blocks, Clarion recognizes these special tokens

Token          Value

%#%            Song number in the play list.
%name%         Name of the song, e.g., 'Canon in D'
%length%       Length of the song in mm:ss
%filelong%     This corresponds to the File column in the play list
%file%         Same as above, except that the drive / path is suppressed
               (if a file) or the CD id# is suppressed (if a CD track).


For example, given

.data.
Song #: %#%
Name: %name% (%length%)
---

.data.

The output will look like:

Song #: 1
Name: Canon in D (2:20)
----

Song #: 2
Name: Another Brick in the Wall (5:14)
----

Song #: 3
Name: Take 5 (4:30)
----

etc.

The best way to see how this all works is to look at the sample .tem file and the file produced with the Export function using that template.

Questions or comments?  Email luutran@geocities.com


