Using the File and Folder Templates

Contents  Previous  Next

Under some circumstances when you save data and report files, Temprecord creates it's own name for the file, and chooses a folder to save the file to.  These circumstances are:

 

when Temprecord data files are saved from an Auto Mode operation.

when the option is selected to create a PDF report from the Print dialog.

when the option is selected to send a PDF report as an email attachment file.

 

In addition, when you read data from a logger and save it to a file, the initial name chosen when the save dialog displays is derived from the default TRX filename template.

 

Temprecord provides the ability to generate file names and folder names based meta data - for example the date the data was read from the logger, the logger serial number, the name of the currently logged in user, etc.  You can also include a unique sequence number that is increased by 1 each time it is used.  A full list of these meta data items is provided below.

 

The format of these file and folder names is determined by templates which you can specify and alter.  When Temprecord is installed, these are set to sensible defaults, but your situation may call for a different file and folder naming convention, in which case you are free to modify them, and Temprecord will remember your preferences.

 

Temprecord assumes that the characters you type into a file or folder specification are meta-characters -i.e. it will try to interpret them as such.  If you don't want this to happen, you must include double quotes around the characters you don't want interpreted.

 

A Quick Example

The most common use of this option is to provide filenames and/or folder names that identify the logger serial number, date and time a logger was read, or the name of the logged-in operator using the computer at the time.

 

For example, if you enter the single character L into the file format specifier, it will be expanded into the serial number of the logger when a file is saved.  The filetype will be  automatically set to .TRX.

 

Format Specifier

Resulting filename

L

S1234567.TRX

 

If you want to include literal text in the filename, so that the characters are not interpreted as codes for meta-data, include the text in double quotes.  So:

 

Format Specifier

Resulting filename

"Logger" L

Logger S1234567.TRX

 

To specify meta data items in a filename or folder specification you can use a special character from the list below, or you can use a meta-string, which is a collection of character Temprecord recognizes as special.  Meta-strings are discussed below.

 

The following table shows how each of the special characters is used.  Any other character or character group not shown in the table below is currently used unchanged in the file or folder name, i.e it is not converted into some other collection of characters.

 

Don't assume that a character not mentioned in the table below will never be used as a formatting character.  Temprecord reserves the right to define additional formatting characters in the future.  If you don't intend characters to be interpreted as formatting characters, it is good practice to always include them in double quotes ("like this").

 

Format Character

What it Produces

c

Displays the date using the format given by the Windows short date format, followed by the time using the format given by the Windows long time format, as specified for that computer in Windows Control Panel. The time is not displayed if the date-time value indicates midnight precisely.

d

Displays the day as a number without a leading zero (1-31).

dd

Displays the day as a number with a leading zero (01-31).

ddd

Displays the day as an abbreviation (Sun-Sat).

dddd

Displays the day as a full name (Sunday-Saturday).

ddddd

Displays the date using the format given by the Windows short date format (nominally M/d/yyyy in the US locale).

dddddd

Displays the date using the format given by the Windows long date format  (nominally dddd, MMMM dd, yyyy in the US locale)

e

Displays the year in the current period/era as a number without a leading zero (Japanese, Korean and Taiwanese locales only).

ee

Displays the year in the current period/era as a number with a leading zero (Japanese, Korean and Taiwanese locales only).

g

Displays the period/era as an abbreviation (Japanese and Taiwanese locales only).

gg

Displays the period/era as a full name. (Japanese and Taiwanese locales only).

m

Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mm

Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mmm

Displays the month as an abbreviation (Jan-Dec).

mmmm

Displays the month as a full name (January-December).

yy

Displays the year as a two-digit number (00-99).

yyyy

Displays the year as a four-digit number (0000-9999).

h

Displays the hour without a leading zero (0-23).

hh

Displays the hour with a leading zero (00-23).

n

Displays the minute without a leading zero (0-59).  Note that this the 'n' character, not the 'm' character.

nn

Displays the minute with a leading zero (00-59).  Note that this the character string 'nn', not 'mm'.

s

Displays the second without a leading zero (0-59).

ss

Displays the second with a leading zero (00-59).

t

Displays the time using the format given by the Windows short time format (nominally h:nn in the US locale).

tt

Displays the time using the format given by the Windows long time format (nominally h:nn:ss in the US locale).

w

Displays the week number  without a leading zero (1-53).

ww

Displays the week number  with a leading zero (01-53).

L

Displays the Logger serial number.

U

Displays the currently logged in Windows user

#

Displays a unique sequence number.  The sequence number is stepped on each time it is used to generate a file or folder name, and it remembered between Temprecord sessions.  It thus provides a convenient way of ensuring unique file or folder names are generated.

z

Displays the current timezone name.  The exact result of using this formatting character is dependent on the date formatting options.  Temprecord attempts to make an abbreviation of the timezone name, for example in Rome during daylight savings (2 hours ahead of GMT), this character formats as "CEST" (Central European Summer Time). If UTC time is selected this formatting character will always cause "UTC" to be displayed.

o

Displays the current timezone offset, in the format SNNNN, where "S" is either "+" or "-", and "NNNN" is the timezone offset expressed relative to GMT in HHMM, for example in Rome during daylight savings (2 hours ahead of GMT), this character formats as "+0200". The exact result of using this formatting character is dependent on the date formatting options.  If UTC time is selected this formatting character will always cause "+0000" to be displayed.

 

 

If you don't want Temprecord to use these date formatting rules on the file or folder name you specify, enclose the entire template in double quotes ("...").

 

Note that the specifier for "minutes" is "n" (not "m", which means "months").

 

Examples

Here are some examples of the filenames generated:

 

Filename Format Specified

Filename Generated

Feature Demonstrated

"data"

data.TR

No formatting

L

S1234567.TR

Logger serial number in filename

"User" U "Logger" L

User Joe Bloggs Logger S1234567.TR

Logged-in user and logger serial number in filename

mmm dd yyyy L

Jan 31 2007 S1234567.TR

Date and logger serial number in filename

mmm dd yyyy hh-mm

Jan 31 2007 12-34.TR

Date and time in filename

L yyyy-mmm-dd hh-mm z

S1234567 2007-Jan-31 12-34 CST.TR

Logger serial number, date and time, timezone in filename.

L #

S1234567 678

Logger serial number and sequence number in filename.

"Saved" dd mmm yy-#

Saved 31 Jan 07-679.TRX

Date and sequence number in filename

 

The same rules apply to the folder specifiers, and you can include path delimiters ("backslashes") in the specifier.  Some examples:

 

Folder Format Specified

Folder Name Generated

Feature Demonstrated

"My data\"

My Data\

No formatting

"My Data\"yyyy\mmm\

My Data\2009\Jun\

Folder tree organized by year, then month

"My Data\"yyyy\ww\

My Data\2009\26\

Folder tree organized by year, then week number

"Files from logger "L

Files from Logger S1234567\

Logger serial number in folder name

"TRX files\"U

TRX files\Joe Bloggs\

Logged-in user in folder name

mmm dd yyyy L

Jan 31 2007 S1234567\

Date and logger serial number in folder name

mmm dd yyyy hh-mm

Jan 31 2007 12-34\

Date and time in folder name

 

Once again, note the use of double quotes around any part of the file or folder name that you don't want to be interpreted as a formatting character.

 

Meta-strings in file and folder specifiers

As well as the formatting characters above, Temprecord allows you to use meta-strings in your file and folder name specifications.  There are meta-strings which are common throughout Temprecord software, and there are some which are particular to filename/folder specifications, and also another set which are recognized in printed output header and footer specifications.  

 

The meta-strings that are common are:

 

Meta-string

Use

Example

Output

%Build%

TRW software build

"Saved with build %Build%"

Saved with build 2533.trx

%Company%

organization name

%Company%

My Company Ltd.trx

%Computer%

computer name

"Saved from PC %Computer%"

Saved from PC Fred's Workstation.trx

%Date%

Inserts the date in the users short date format

"Reception %Date%"

Reception 23-8-2012.trx

%DateTime%

Inserts the date and time in the users short date and long time format

"Saved %DateTime%"

Saved at 23-8-2013 15_09_26.trx

%Time%

Inserts the current time in the user's long time format

"Saved at %time%"

Saved 10_08_42.trx

%User%

logged in Windows user

"Saved by user %User%"

Saved by user Fred.trx

%Version%

TRW software version

"Saved with v%Version%"

Saved with v5.28.0.2533.trx

%Workgroup%

computer workgroup

"This file is from the %Workgroup% group"

This file is from the Administration group.trx

%%<env var>%%

environment variable

"%%TEMP%%"

C:\DOCUME~1\jrm\LOCALS~1\Temp\

 

The following meta-strings are expanded into various parameters and statistics from the logger data set:

 

Meta-string

Use

Example

Output

%Samples%

number of samples

Logger  %SN% "(%Samples% samples)"

Logger S1234567 (1778 samples)

%Markers%

number of markers

Logger  %SN% "(%Markers% markers)"

Logger S1234567 (17 markers)

%SamplePeriod%

sample period

Samples were %SamplePeriod% apart

Samples were 0:02:30 apart

%StartDelay%

start delay

Logger start delay was %StartDelay%

Logger start delay was 0:01:00

%StartSample%

start sample (F7 key)

Statistics are for samples %StartSample% to %EndSample%

Statistics are for samples 100 to 199

%EndSample%

end sample (F8 key)

Statistics are for samples %StartSample% to %EndSample%

Statistics are for samples 100 to 199

%StartDate%

date of start sample

Statistics are for samples between %StartDate% and %EndDate%

Statistics are for samples between  12-11-2013 10:00:14 and 13-11-2013 02:10:44

%EndDate%

date of end sample

Statistics are for samples between %StartDate% and %EndDate%

Statistics are for samples between  12-11-2013 10:00:14 and 13-11-2013 02:10:44

%FirstDate%

date of first sample

Logger first sample taken was at %FirstDate%

Logger first sample taken was at 12-11-2013 08:00:14

%LastDate%

date of last sample

Logger last sample taken was at %LastDate%

Logger last sample taken was at 13-11-2013 02:10:44

%User1%..
%User5%

Lines 1..5 of user data.

%User1%, %User2%

Contents: Frozen Lamb, Origin: Auckland Coolstore

%UserData%

All lines of user data (only valid inside the body of an email - %UserData% is not recognized inside the subject line of an email)

User Data:

%UserData%

User Data:

Contents: Frozen Lamb

Origin: Auckland Coolstore

Destination: Christchurch

Container: SKK2311

%NPS%

name of any programmed Named Parameter Set

Parameters: %NPS%

Parameters: Conditioned blood products

%Filepath%

The path portion of the data file associated with the dataset

Path: %Filepath%

Path: C:\My Datafiles\

%Filename%

The filename  portion (i.e. with no path and no extension) of the data file associated with the dataset

Name: %Filename%

Name: Freezer No 7

%FileID%

The fileID portion (i.e. with no path but including the extension) of the data file associated with the dataset

Name: %FileID%

Name: Freezer No 7.trx

%SN%

logger serial number in a formatted form (generally a letter followed by 7 digits)

Logger %SN%

Logger s1234567

%Owner%

programmed owner name

Return logger to %Owner%

Return logger to Waikato

%Firmware%

version number of logger firmware.

%Firmware%

4.1.6.0

%TMean%

mean value of temperature samples between start and end samples

Mean temperature between %StartDate% and %EndDate% was %TMean%

Mean temperature between 12-11-2013 10:00:14 and 13-11-2013 02:10:44 was -18.311

%TMax%

maximum temperature between start and end

Maximum temperature between %StartDate% and %EndDate% was %TMax%

Maximum temperature between 12-11-2013 10:00:14 and 13-11-2013 02:10:44 was -17.580

%TMin%

minimum temperature between start and end

Minimum temperature between %StartDate% and %EndDate% was %TMin%

Minimum temperature between 12-11-2013 10:00:14 and 13-11-2013 02:10:44 was -18.950

%TMaxSample%

sample number of maximum temperature

Maximum temperature (%TMax%) occurred sample %TMaxSample% at %TMaxDate%

Maximum temperature (-17.580) occurred sample 3312 at 12-11-2013 23:38:14

%TMinSample%

sample number of minimum temperature

Minimum temperature (%TMin%) occurred sample %TMinSample% at %TMinDate%

Minimum temperature (-18.950) occurred sample 3465 at 13-11-2013 02:57

%TMaxDate%

date-time of maximum temperature

Maximum temperature (%TMax%) occurred sample %TMaxSample% at %TMaxDate%

Maximum temperature (-17.580) occurred sample 3312 at 12-11-2013 23:38:14

%TMinDate%

date-time of minimum temperature

Minimum temperature (%TMin%) occurred sample %TMinSample% at %TMinDate%

Minimum temperature (-18.950) occurred sample 3465 at 13-11-2013 02:57

%MKT%

mean kinetic  temperature between start and end samples

Mean kinetic temperature between samples %StartSample%-%EndSample% was %MKT%

Mean kinetic temperature between samples 100-199 was -18.905

%HMean%

mean value of humidity samples between start and end samples

Mean humidity between %StartDate% and %EndDate% was %TMean% %RH

Mean humidity between 12-11-2013 10:00:14 and 13-11-2013 02:10:44 was 64.2 %RH

%HMax%

maximum humidity between start and end

Maximum humidity between %StartDate% and %EndDate% was %HMax% %RH

Maximum humidity between 12-11-2013 10:00:14 and 13-11-2013 02:10:44 was 70.0 %RH

%HMin%

minimum humidity between start and end

Minimum humidity between %StartDate% and %EndDate% was %HMin% %RH

Minimum humidity between 12-11-2013 10:00:14 and 13-11-2013 02:10:44 was 58.5 %RH

%HMaxSample%

sample number of maximum humidity

Maximum humidity (%HMax% %RH) occurred sample %HMaxSample% at %HMaxDate%

Maximum humidity (70.0 %RH) occurred sample 3312 at 12-11-2013 23:38:14

%HMinSample%

sample number of minimum humidity

Minimum humidity (%HMin% %RH) occurred sample %HMinSample% at %HMinDate%

Minimum humidity (58.5 %RH) occurred sample 3465 at 13-11-2013 02:57

%HMaxDate%

date-time of maximum humidity

Maximum humidity (%HMax% %RH) occurred sample %HMaxSample% at %HMaxDate%

Maximum humidity (70.0 %RH) occurred sample 3312 at 12-11-2013 23:38:14

%HMinDate%

date-time of minimum humidity

Minimum humidity (%HMin% %RH) occurred sample %HMinSample% at %TMinDate%

Minimum humidity (58.5 %RH) occurred sample 3465 at 13-11-2013 02:57

 

Meta-strings in file and folder specifiers are just like meta-characters, but when using meta-strings to generate file and folder names, the meta-string identifier must be inside double quotes, as shown in the above examples. A meta-string outside of quotes will be interpreted as a series of date-formatting characters, which will produce all manner of confusing results!

When meta-string specifications are used in file and folder templates, the resulting filename may contain characters that are invalid in a Windows filename.  If this occurs, Temprecord "sanitizes" the file or folder name by substituting the "safe" character underscore ("_").  For example a file template specification of "Saved at %Time%" would produce a result of Saved at 10_08_42.trx , rather than Saved at 10:08:42.trx , which would upset Windows, as a colon (":") is not a valid character in a filename.

 

See also:

Default TRX Filename

Folder for .TRX Files

Default PDF Filename

Folder for .PDF Files

When are default filename and folders used?

Date Formatting Options

Meta-strings

Meta-strings in email messages

Meta-strings in printed reports headers and footers

Meta-strings in user data

Meta-strings in parameter sets

 


(C) 1992-2019 Temprecord International Ltd
17/07/2014 6:12:32 PM
Temprecord Web Help