Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forumdisplay.php?f=20)
-   -   C Parser for parsing and reading Config file with defined format? (http://www.go4expert.com/showthread.php?t=25223)

ram.sj 11Mar2011 15:56

C Parser for parsing and reading Config file with defined format?
 
Hi,
I need to parse a configuration file , I need to compare the string variable and get the values.

The variable and values are seperated by white spaces,
For example,
TestscenConf.config file contains the following,

SCENARIO_TYPE WIRELESS_TEST

SIMULATION_TIME 200

[1] [IP_ADDR1][1] 192.168.1.0

[2] [IP_ADDR2][1] 192.168.1.2

[2] [IP_ADDR2][2] 192.168.1.3

Here, everything is seperated by space.

I want to compare variable name and get its value.

How can I parse it in C or C++.

Thank you,

Arun


All times are GMT +5.5. The time now is 00:28.