Back to Yq

Load

pkg/yqlib/doc/operators/headers/load.md

4.53.2931 B
Original Source

Load

The load operators allows you to load in content from another file.

Note that you can use string operators like + and sub to modify the value in the yaml file to a path that exists in your system.

You can load files of the following supported types:

FormatLoad Operator
Yamlload
XMLload_xml
Propertiesload_props
Plain Stringload_str
Base64load_base64

Note that load_base64 only works for base64 encoded utf-8 strings.

Samples files for tests:

yaml

../../examples/thing.yml:

yaml
a: apple is included
b: cool

xml

small.xml:

xml
<this>is some xml</this>

properties

small.properties:

properties
this.is = a properties file

base64

base64.txt:

bXkgc2VjcmV0IGNoaWxsaSByZWNpcGUgaXMuLi4u

Disabling file operators

If required, you can use the --security-disable-file-ops to disable file operations.