Filtering Data in a Text File with Python
Posted
by
YAS
on Stack Overflow
See other posts from Stack Overflow
or by YAS
Published on 2011-01-14T05:11:01Z
Indexed on
2011/01/14
18:53 UTC
Read the original article
Hit count: 163
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?
© Stack Overflow or respective owner