How does one read data from a config file?

Since my last thread, thanks to you guys I’ve made quite some headway with my plugins development.
However as always before i’m never quite sure how certain things are done.
For instance. I found that you can read a file with file.read. Like such: file.Read(“plugin.txt”, “DATA”).

However I find that when I try to do this the output is the entire file as one thing. However it would realy help if I knew:
-How to extract specific data from a file (For a .cfg file / any in general)

Again I tried googleing for the answer with many different keywords and in different wordings and arrangements.
Found nothing so I turn to the pro’s.
This is something I’ve not been able to do ever and it keeps bugging me.
I’m certain I am supposed to in some fashion splice it up but lack the technical knowhow to do so. (Kinda like google handles search terms, they are one string but it gets divided where the spaces are)

I know that much but have no idea how to do this…

…/

And now in english please.

file.Read( “cfg/server.cfg”, “GAME” )

There are two stages to getting data from a file, getting the file read. Wich in my example I stated I already know how to do.

And the second one wich is converting it into several variables or strings or whatever.
I’m looking to find out how to do stage 2. Not stage 1. Thanks for trying though. Robotboy655.

You can try util.KeyValuesToTable( file_contents), if it wont work, you’ll have to write a parser from scratch.

Guess il have to write my own parser. But i’m not sure how to do it.
Marking as solved as I think I got it down.