Any way to load and parse a .cfg file?

I’m trying to load in data from a config (cfg) file and parse it into a custom data struct.
I know how to do this with json and xml formats but was wondering if there’s an addon or built-in support for loading this file format to oF ?

Thanks

assuming it is in this sort of format:

DOS=HIGH,UMB
DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE RAM
DEVICEHIGH=C:\DOS\ANSI.SYS
FILES=30
SHELL=C:\DOS\COMMAND.COM C:\DOS /E:512 /P

You could use do something like this.

//get an ofBuffer from the file
ofBuffer buffer = ofBufferFromFile("myFile.cfg");

//for each line in the file

for( auto line : buffer.getLines()){

    //turn the line of text into an array/vector of two or more elements split by the = symbol
    auto arr = ofSplitString(line, "=");
    
    //for a line like
    //FILES=30
    if( arr.size() >= 2 ){
        
        //var would be FILES
        //value would be 30 ( as a string )
        string var = arr[0];
        string value = arr[1];
        
        cout << " var is " << var << " value is " << value << endl;
        
    }
}

Thanks @theo I may have to write my own parser as you suggest, or include a 3rd party lib.
The file format is similar to .ini and contains nodes such as

[cluster_node] id=“n1” addr=“192.168.1.12”
[cluster_node] id=“n2” addr=“192.168.1.22”

etc

In fact what I want to do is load in a .cfg file and extract all elements with the [cluster_node] label and then get the IP address from each. I can do it easy enough with a few lines of code it’s just that I read here that someone thought it was included in the ofxXmlSettings addon (though I couldn’t even load a .cfg file using that addon) so I thought I would check if there was a lib / addon already.

Thanks!