open

Opens a new output file.

Syntax

open str_expr

Input

str_expr
The path and file name to which the redirected output is sent.

Example

Example 1
{'Create a file containing today's date}
{open "date.fil"}
 {date()}
{close}
Example 2
{file_name = "time_stamp.out"}
{open file_name}
 {date("%A")} : {time()}
{close}

Comments

When Templex processes a template file, output is sent to either stdout or a file specified in the command line. Output can be redirected to a file using the open statement. If the output is closed, it is then sent to either the next remaining open output file or the file specified on the command line if all other output files are closed.

str_expr can be any literal text string or expression that returns a string. If str_expr is literal text, it must be in double quotes.