.properties file extension is used for loading context variables through a file in Talend. In tFileProperties, while selecting the file format for parameter file, we have a drop down of .properties and .ini extension also. I want to know what is the difference between .ini and .properties file format in relevance to parameter file extensions in Talend. In which case we use .ini extension?
Documentation says that the only difference is that the .ini files are regrouped in sections, which are somewhat iterated, which I failed to understand. Can anyone elaborate with an example?
Both file types allow you to declare key/value pairs like so:
key=value
The difference between the two is that .ini uses sections. tFileInputProperties
allows you to read a section by its name:
The big advantage of this over .properties file is that .ini file can have the same variable inside multiple sections. For instance, your sections can be your execution environments (DEV, PROD..etc) with your variable having a different value for each environment. You can then get the value by reading only the section corresponding to your execution environment (section can be a context variable).
This what I get by setting section to "DEV":
If you declare the same variable in .properties file multiple times, the last occurence of the variable is the one that will be returned. Suppose my file looks like this :
This is the result (notice how only 2 rows are read, and not the 4 present in the file)