Re: need help extracting data from a text file

2005-11-09 Thread Tom Anderson
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

Re: need help extracting data from a text file

2005-11-07 Thread Kent Johnson
[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

Re: need help extracting data from a text file

2005-11-07 Thread Paul McGuire
<[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

Re: need help extracting data from a text file

2005-11-07 Thread nephish
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

Re: need help extracting data from a text file

2005-11-07 Thread Iain King
[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("("

Re: need help extracting data from a text file

2005-11-07 Thread nephish
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

Re: need help extracting data from a text file

2005-11-07 Thread Iain King
[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

need help extracting data from a text file

2005-11-07 Thread nephish
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