Advanced Renaming with Path Templates
Filestar has a powerful renaming system that allows you to control the filename for the produced files.
In the following examples let's assume that we are converting the file cat.jpg
to a png image. The following path template will give us the filename cat.png
:
<Filename>.<Extension>
Anything between <
and >
is a special tag that is replaced with a value. Between the tags, you can have any characters to form your path and filenames.
By specifying path templates you can create advanced renaming rules. Here's an example:
<Image.Location>\<Image.Year>-<Image.Month>-<Image.Day>\<Filename>.<Extension>
=> "New York\1982-07-17\Photo.jpg"
Supported Tags
Filename
Is replaced with the name of the original file excluding the extension.
Extension
Is replaced with the new extension.
Order
Some skills return more than one file (like splitting a document into images). The
<Filename>_<Order Format="D3">.<Extension>
=> "Document_001.jpg", "Document_002.jpg"...
Page
Works the same way as the
Guid
Is replaced with a new Guid.
ArchivePath
This tag is used when extracting files from an archive like a zip file extract the files with the same folder structure as in the archive.
Md5
Is replaced with the Md5 hash of the file.
File
Is replaced with a file property.
<File.Created Format="yyyy-MM-dd">
<File.Modified Format="yyyy-MM-dd">
Image
Is replaced with image metadata.
<Image.Title>
<Image.Latitude>
<Image.Longitude>
<Image.Year>
<Image.Month>
<Image.Day>
<Image.Taken Format="yyyy-MM-dd">
<Image.Location>
Mp3
Is replaced with mp3 metadata.
<Mp3.Title>
<Mp3.Album>
<Mp3.Artist>
<Mp3.Track>
<Mp3.Subtitle>
<Mp3.Year>
<Mp3.Genre>
<Mp3.Composer>
<Mp3.Disc>
Tag
The
Case.Lower
Method for lowercasing.
<Case.Lower><Filename></Case.Lower>
Case.Upper
Method for uppercasing.
<Case.Upper><Filename></Case.Upper>
Trim
Method for removing unwanted characters at the start or at the end of a string.
<Trim Chars="_"><Filename></Trim>
Substring
Method for cutting out a piece of a string.
<Substring Index="0" Length="5"><Filename></Substring>
Replace
Method for replacing all occurrences of one string to another.
<Replace Old="x" New="y"><Filename></Replace>