Filtering Data in a Text File with Python
- by YAS
I'm new to Python (like Zygote new), and it's just to supplement another program but what I need is I have a text file that's a group of items for a game and it is formatted so:
[1]
Name=Blah
Faction=Blahdiddly
Cost=1000
[2]
Name=Meh
Faction=MehMeh
Cost=2000
[3]
Name=Lollypop
Faction=Blahdiddly
Cost=100
And I need to be able to find out what groups (the numbers in brackets) have matching values.
So if I search Faction=Blahdiddly Group 1 & 3 will come up.
I unfortunately have NO idea how to do this.
Can anyone help?