need help extracting data from a text file

Iain King iainking at
Mon Nov 7 17:43:12 CET 2005

nephish at wrote:
> this is cool, it is only going to run about 10 times a day,
> the text is not written out like foo(bar) its more like
> foo blah blah blah (bar)

then I guess you worked this out, but just for completeness:

keywordPos = textfile.find("foo")
start = textfile.find("(", keywordPos)
end = textfile.find(")", start)
value = textfile[start:end]


More information about the Python-list mailing list