For an .ini file with property_value pair, I’d like to define the datatype for property_name such that I will convert the datatype based on the input argument data type .
For this reason I have been trying to read the specificed datatype from the ini file in struct format. However I am getting the error : invalid fieldname. How can I define property_name and datatype such that I’ll be able to read it, and also be able to write to the ini file if i’d like to add property_datatype_vlaue pair?
[system] % string
value
[application] % string
value
I also need tot be able to set this datatype from my input argument.
How to sort property -value pair in alphabetical order with Matlab
Modifying the
structfrom this answer to contain value and typeAssumptions:
The properties’ names are legitimate Matlab field names (see variable naming for details).
The value of each property is always a string.
I did not include any error-checking code in these examples (files not found, wrongly formatted strings, etc.)
I assume the input file is strictly “[prop] val” pairs without any additional comments etc.