read properties file into map (filename a, [encoding b], map c)
Group |
This function can read a properties file from local file system and insert the key-value pairs into a named map. The map is not cleared before. The name of the map is expected in the mandatory parameter c. There is no default name. If a named map with this name did not exist before it is created.
The mandatory parameter a gives the relative or absolute path for the properties file. If this file does not exist, the function will fail with an error.
By default, a properties file has the character encoding ISO-8859-1. However, the optional parameter b can specify another encoding.
The return value is the count of key-value pairs within the map after execution.
Description of Parameters
Parameter |
Description |
a |
Filename. |
b |
(optional) Encoding. Default: 8859_1 |
c |
Name of map. |
Examples
Assume, that the Map ABC was empty or did not exist and the file ./conf/xyz.properties is a properties file with 8859_1 encoding containing three properties with unique keys.
Parameter a |
Parameter b |
Parameter c |
Result |
./conf/xyz.properties |
ABC |
3 |
The real result of the function is that now a named map object ABC exists, which contains three key-value pairs.
See Also
csv-into-map(file a, [mapname b], [keycol(s) c], [csv delim d], [csv encoding e], [clear first f])
fill-map-from-fields( map a, prefix b, index c, hidden d, [processing e] )
get value from map(key a, name of map b, delimiter c, item d)
select into map(a,b,[param &1 = c], d,e, f,g,h,i,j], delimiter k, map l, m)