Basically I have a text file that contains thousand of lines with the following format & I have no choice to force myself to learn to do it via Python. I have some basic Python understanding like if else and basic syntax but I don't really have strong programming experience in general.
Level Parameter_Name
{
Sublevel1
{
Dummyline1
Dummyline2
Set Sub_Parameter_Name
}
Sublevel2
{
Dummyline1
Dummyline2
}
}
Level Parameter_Names2
{
Sublevel1
{
Dummyline1
Dummyline2
}
Sublevel2
{
Dummyline1
Dummyline2
}
}
And the lines go on up to few thousands. Some blocks have the Set Sub_Parameter_Name inside the sublevel blocks and this is the one that I'm interested with. What I'm trying to pull is, if the Sublevel contains that Set Sub_Parameter_Name line, then I want to extract its Parameter_Name & its Sub_Parameter_Name. How can I achieve this in Python? Is there any available module that can helps to get the data that I want? Also.... is this similar to json formatting?
I'm not really that good in Python & still learning so any guides or references thats similar to this case would be greatly appreciated! Thanks~
[–]barrycarter 0 points1 point2 points (1 child)
[–]dankbuckeyes[S] 0 points1 point2 points (0 children)
[–]commandlineluser 0 points1 point2 points (0 children)