loadenv
Load environment variables defined in .env or regular text files.
📝Syntax
loadenv(filename)
D = loadenv(filename)
📥Input Arguments
Parameter Description
filename string scalar, character vector: environment filename.
📤Output Arguments
Parameter Description
s dictionary: the environment variables and their values.
📄Description

loadenv(filename) loads environment variables from a .env or plain text file by parsing one key-value pair per line and sets them as environment variables in the Nelson environment.

D = loadenv(filename) returns a dictionary containing the parsed key-value pairs. When an output argument is specified, loadenv does not modify the Nelson environment.

💡Examples
env_file = [modulepath('os_functions', 'tests'), '/sample.env'];
D = loadenv(env_file)
getenv('Key1')
loadenv(env_file)
getenv('Key1')
🔗See Also
setenvgetenv
🕔Version History
Version Description
1.15.0 initial version
Edit this page on GitHub