On Mon, 7 Nov 2005, Kent Johnson wrote:
> [EMAIL PROTECTED] wrote:
>
>> i have a text file with a bunch of values scattered throughout it. i am
>> needing to pull out a value that is in parenthesis right after a
>> certain word, like the first time the word 'foo' is found, retrieve the
>> value
[EMAIL PROTECTED] wrote:
> Hey there,
> i have a text file with a bunch of values scattered throughout it.
> i am needing to pull out a value that is in parenthesis right after a
> certain word,
> like the first time the word 'foo' is found, retrieve the values in the
> next set of parenthesis (bar
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey there,
> i have a text file with a bunch of values scattered throughout it.
> i am needing to pull out a value that is in parenthesis right after a
> certain word,
> like the first time the word 'foo' is found, retrieve the values in
um, wait. what you are doing here is easier than what i was doing after
your first post.
thanks a lot. this is going to work out ok.
thanks again.
sk
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] 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("("
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)
the thing is , every few days the structure of the textfile may change,
one of the reasons i wanted to avoid the re.
thanks for the tip,
--
http://mail.p
[EMAIL PROTECTED] wrote:
> Hey there,
> i have a text file with a bunch of values scattered throughout it.
> i am needing to pull out a value that is in parenthesis right after a
> certain word,
> like the first time the word 'foo' is found, retrieve the values in the
> next set of parenthesis (ba
Hey there,
i have a text file with a bunch of values scattered throughout it.
i am needing to pull out a value that is in parenthesis right after a
certain word,
like the first time the word 'foo' is found, retrieve the values in the
next set of parenthesis (bar) and it would return 'bar'
i think