input_nml: Input values into nml file

input_nmlR Documentation

Input values into nml file

Description

Inputs values into nml file by locating the label and key within the nml file. Preserves comments (!) if present. NOTE: this does not use a nml parser so if there are nml formatting errors this function will not pick them up.

Usage

input_nml(file, label, key, value, out_file = NULL)

Arguments

file

filepath; to nml file which you wish to edit

label

string; which corresponds to section where the key is located

key

string; name of key in which to input the value

value

string; to be input into the key/value pair. Note boolean values must be input as 'true'/'false' as per the nml format

out_file

filepath; to write the output nml file (optional); defaults to overwriting file if not specified

Author(s)

Tadhg Moore

Examples

input_nml(file = 'samp.nml', label = "LAKE_PARAMS", key = "depth_w_lk", value = 14, out_file = NULL)

aemon-j/gotmtools documentation built on April 12, 2024, 4:35 p.m.