replace value(a, name of file b, default value c[, wildcard d])
Group |
Searches for key a in properties file b and returns its value.
If a is not found, c will be returned.
If parameter d is set to true, keys in the property file may contain the wildcard *. See examples.
Description of Parameters
Parameter |
Description |
a |
Key to be searched for in b. |
b |
Name of the properties file. |
c |
Default return value if key is not found. |
d |
(optional) true for wildcard support. Default: false. |
Examples
Assume the following properties file ./conf/replacements.properties.
# Country name to country code
Germany=DE
Austria=AT
New\ Zealand=NZ
Note: The backslash in New\ Zealand is a so-called escape character in properties file. For more information, see section Structure of a Properties File.
Parameter a |
Parameter b |
Parameter c |
Parameter d |
Result |
Germany |
./conf/replacements.properties |
Somewhere |
|
DE |
Austria |
./conf/replacements.properties |
Somewhere |
|
AT |
New Zealand |
./conf/replacements.properties |
Somewhere |
|
NZ |
Dreamland |
./conf/replacements.properties |
Somewhere |
|
Somewhere |
Assume another properties file ./conf/replacements.properties instead.
# Shortcuts for names
Invoice*=Invoice address
Number*=Number range
Parameter a |
Parameter b |
Parameter c |
Parameter d |
Result |
Invoices |
./conf/replacements.properties |
Nothing |
true |
Invoice address |
Invoices |
./conf/replacements.properties |
Nothing |
false |
Nothing |
See Also
replace value by range(a, name of file b, default value c[, comparetype d])
replace value(a, csv/xls(x) b, column c, default d, [encoding e, key column f, delimiter g, sheet h]
replace value(a, csv b, column c, default d, [encoding e, key column f])
replace value(a, list b, list c, default d, [contains-mode e])