Hi guys,
I need some help coding a little "search a textfile for some info" script:

I have a plain text file that looks like the following:

Code:
[Entry13]
names=nom1 nom2 nom5 nom8
update=2011-05
sports=sp1 sp3 sp5 sp7 sp9

[Entry56]
names=nom1 nom2 nom3 nom4
update=2011-07
sports=sp1 sp2 sp3 sp4 sp5

[Entry9]
names=nom1 nom2 nom5 nom8
update=2011-07
sports=sp4 sp6 sp8 sp10


...and so on...
If I type "!names Entry13" it will return "nom1 nom2 nom5 nom8". That works and is not the problem.

But what Im missing is the option to search through all entries, for example:
typing "!names nom4" should return "nom4 belongs to Entry56"
while "!names nom8" should return "nom8 belongs to Entry13 Entry56"
also "!sports sp4" should return "sp4 is part of Entry56 Entry9"
and "!sports sp10" should return "sp10 is part of Entry9"

So it should go and check every EntryXX and return the ones that match as described above.
On the one hand that sounds quite simple, but on the other hand I'm not a programmer and therefor I have no real clue how to write the corresponding code for it.


So any help is highly appreciated.
Many Thanks in advance. smile