I'm trying to parse big text files with python.
These files have a syntax like this:
<option1> {
<variable1>=<value1>; //<comment>
<variable2>=<value2>;
..
<variableN>=<valueN>; //<comment>
}
<option2> {
<variable1>=<value1>; //<comment>
<variable2>=<value2>;
..
<variableN>=<valueN>; //<comment>
}
...
...
<optionN> {
<variable1>=<value1>; //<comment>
<variable2>=<value2>;
..
<variableN>=<valueN>; //<comment>
}
And I want to get for instance <optionK>[<variableT>]
value.
Is there an optimal way to do this by using a fileparser?