C Parser for parsing and reading Config file with defined format?

Discussion in 'C' started by ram.sj, Mar 11, 2011.

  1. ram.sj

    ram.sj New Member

    Joined:
    Dec 26, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice