WOLFRAM

FileTemplate["file"]

yields a TemplateObject expression that represents a file template to be applied using functions like TemplateApply.

uses File[], URL[], or CloudObject[] as the specification for the file location.

FileTemplate[form,args]

yields a TemplateObject with arguments, suitable for cloud deployment or other evaluation.

Details and Options

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Loading a template file from disk:

Out[1]=1

Applying to a FileTemplate:

Out[2]=2

Saving a template to disk:

Out[3]=3

The type of template to use is by default determined by the extension:

Out[4]=4

Evaluate $TemplatePath to see where FileTemplate is searching for templates:

Out[5]=5

Scope  (3)Survey of the scope of standard use cases

File is fully supported:

Out[1]=1

Templates can be hosted in the Wolfram Cloud:

Out[1]=1
Out[2]=2

URL can be used to fetch templates:

Out[1]=1
Out[2]=2
Out[3]=3

URL can be directly used by TemplateApply:

Out[4]=4

Options  (2)Common values & functionality for each option

InsertionFunction  (1)

Specify a function to convert arguments before they are inserted:

Out[1]=1
Out[2]=2

You can use a string to specify an export format:

Out[3]=3

CombinerFunction  (1)

Specify a different way to combine parts of templates:

Out[1]=1

Properties & Relations  (1)Properties of the function, and connections to other functions

If you deploy a template with data, each time you visit it TemplateApply will render the content again:

Out[1]=1
Wolfram Research (2014), FileTemplate, Wolfram Language function, https://reference.wolfram.com/language/ref/FileTemplate.html.
Wolfram Research (2014), FileTemplate, Wolfram Language function, https://reference.wolfram.com/language/ref/FileTemplate.html.

Text

Wolfram Research (2014), FileTemplate, Wolfram Language function, https://reference.wolfram.com/language/ref/FileTemplate.html.

Wolfram Research (2014), FileTemplate, Wolfram Language function, https://reference.wolfram.com/language/ref/FileTemplate.html.

CMS

Wolfram Language. 2014. "FileTemplate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FileTemplate.html.

Wolfram Language. 2014. "FileTemplate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FileTemplate.html.

APA

Wolfram Language. (2014). FileTemplate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileTemplate.html

Wolfram Language. (2014). FileTemplate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileTemplate.html

BibTeX

@misc{reference.wolfram_2025_filetemplate, author="Wolfram Research", title="{FileTemplate}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/FileTemplate.html}", note=[Accessed: 29-March-2025 ]}

@misc{reference.wolfram_2025_filetemplate, author="Wolfram Research", title="{FileTemplate}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/FileTemplate.html}", note=[Accessed: 29-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_filetemplate, organization={Wolfram Research}, title={FileTemplate}, year={2014}, url={https://reference.wolfram.com/language/ref/FileTemplate.html}, note=[Accessed: 29-March-2025 ]}

@online{reference.wolfram_2025_filetemplate, organization={Wolfram Research}, title={FileTemplate}, year={2014}, url={https://reference.wolfram.com/language/ref/FileTemplate.html}, note=[Accessed: 29-March-2025 ]}