need help extracting data from a text file

Iain King iainking at gmail.com
Mon Nov 7 11:43:12 EST 2005


nephish at xit.net 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]


Iain




More information about the Python-list mailing list