Deven,
Doesn't {headline:-1} just return the last character of the field? What I want to do is remove the last character of the field.
Example (note * represents a CR), the headline field contains
John*
What I want is
John
Since the length of each name varies, what I need is something like:
{headline:0:length of headline minus one}
You're right. You'll want to use {headline:0,-1} instead. From the manual:
Substring extraction can be used to ‘extract’ a range of characters from an image variable so they can be used as normal variables in other fields throughout Photo Mechanic.
The format is:
{variable:index,count:conversion} or {variable:index:conversion}
In either case, <:conversion> is optional
<index> Sets the point in the string at which the operation starts - zero (0) will include all characters, 1 will ignore the first character etc. This value can be positive
or negative. Negative numbers count back from the end of the string, positive numbers count from the beginning.
<count> to extract <count> characters from <index>. <count> may also be omitted altogether which indicates extracting the substring from <index> position to the end of the string.
<conversion> may be one of the following types or may be omitted altogether:
“lc” perform lower-case conversion of all applicable characters
“UC” perform upper-case conversion of all applicable characters
“PC” perform Proper Name case conversion
Here are some examples:
Let’s say {filenamebase} is DSC_1234
Then:
{filenamebase:0,3} yields: DSC
{filenamebase:-4,4} yields: 1234
{filenamebase:-4} yields: 1234
{filenamebase:2,3} yields: C_1
{filenamebase:0:lc} yields: dsc_1234
{filenamebase:0:PC} yields: Dsc_1234
-Kirk