Skip to main content

Read variables from file

Read name=value lines (a settings or .properties-style file) into a Dictionary; blank lines and lines starting with # or ; are skipped.

Command in the File toolkit · id ooa.file/read_variables · 6 inputs (1 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
PathFileYesText file with one name=value per line.
SeparatorStringNo=Text between the name and the value, e.g. = or : or a tab (\t).
EncodingStringNoutf-8Text encoding: utf-8, ansi, unicode ...
TrimBooleanNotrueRemove spaces around names and values.
Trim sideStringNobothWhich spaces trim removes: on both sides, only before, or only after the name and the value.
Lowercase keysBooleanNofalseTurn names into lower case, so Server and server are the same variable.

Outputs​

OutputTypeWhat it is
valuesDictionaryName to value, in file order.
countNumberNumber of values read.