Paul Melvin wrote:
Hi,
Thanks very much to all your suggestions, I am looking into the suggestions
of Hugo and Alan.
The file is not very big, only 700KB (~2 lines), which I think should be
fine to be loaded into memory?
I have two further questions though please, the lines are like this:
On Fri, Jan 15, 2010 at 4:24 AM, Paul Melvin
wrote:
> Hi,
>
> Thanks very much to all your suggestions, I am looking into the suggestions
> of Hugo and Alan.
>
> The file is not very big, only 700KB (~2 lines), which I think should be
> fine to be loaded into memory?
>
> I have two further que
Hi,
Thanks very much to all your suggestions, I am looking into the suggestions
of Hugo and Alan.
The file is not very big, only 700KB (~2 lines), which I think should be
fine to be loaded into memory?
I have two further questions though please, the lines are like this:
On 01/14/10 10:29, Hugo Arts wrote:
> On Thu, Jan 14, 2010 at 12:05 AM, Alan Gauld
> wrote:
>> >
>> > I prefer the next() approach.
> Rightfully so. IMO, The while loop with readline is basically the C
> version of that, for the poor people who don't have iterators.
I would often prefer while lo
"spir" wrote
But a third option is to use a split and apply it to the whole file as
a string thereby breaking the file into as many chunks as start with
a line containing 'NEW'...
Why not simply a regex pattern starting with "NEW" and ending with '\n'?
Because I understood the OP had to e
On Wed, 13 Jan 2010 23:05:11 -
"Alan Gauld" wrote:
> But a third option is to use a split and apply it to the whole file as
> a string thereby breaking the file into as many chunks as start with
> a line containing 'NEW'...
Why not simply a regex pattern starting with "NEW" and ending with '
On Thu, Jan 14, 2010 at 12:05 AM, Alan Gauld wrote:
>
> I prefer the next() approach.
Rightfully so. IMO, The while loop with readline is basically the C
version of that, for the poor people who don't have iterators.
> But a third option is to use a split and apply it to the whole file as
> a st
"Hugo Arts" wrote
the most obvious answer would be to take a look at the 'next()'
function, that should solve this immediate problem.
This would be nmy advice too, but you need to get an explicit iterator to
use it.
it = open(.)
for line in it:
if 'NEW' in line:
ln = it.next
On Wed, Jan 13, 2010 at 6:49 PM, Paul Melvin
wrote:
> Hi,
>
> I have a file generated from a webpage.
>
> I want to search that file for a specific keyword, in my case 'NEW'.
>
> Once I have found that keyword I want to retrieve information below it, e.g.
> web link, size of file etc.
>
> When I h
On 1/13/2010 9:49 AM Paul Melvin said...
Hi,
I have a file generated from a webpage.
I want to search that file for a specific keyword, in my case 'NEW'.
Once I have found that keyword I want to retrieve information below it, e.g.
web link, size of file etc.
When I have this information I mov
> I have a file generated from a webpage.
> I want to search that file for a specific keyword, in my case 'NEW'.
> Once I have found that keyword I want to retrieve information below it, e.g.
> web link, size of file etc.
> When I have this information I move off until I find another 'NEW' and the
Hi,
I have a file generated from a webpage.
I want to search that file for a specific keyword, in my case 'NEW'.
Once I have found that keyword I want to retrieve information below it, e.g.
web link, size of file etc.
When I have this information I move off until I find another 'NEW' and the
pr
12 matches
Mail list logo