On Fri, 17 Dec 2004 14:22:34 +, rumours say that [EMAIL PROTECTED]
might have written:
sf:
>sf wrote:
>> The point is that when you have 100,000s of records, this grep becomes
>> really slow?
>
>There are performance bugs with current versions of grep
>and multibyte characters that are only g
sf wrote:
The point is that when you have 100,000s of records, this grep becomes
really slow?
There are performance bugs with current versions of grep
and multibyte characters that are only getting addressed now.
To work around these do `export LANG=C` first.
In my experience grep is not scalable s
On Fri, 17 Dec 2004 12:21:08 +, rumours say that [EMAIL PROTECTED]
might have written:
[snip some damn lie aka "benchmark"]
[me]
>> (Yes, I cheated by adding the F (for no regular expressions) flag :)
>
>Also you only have 1000 entries in B!
>Try it again with all entries in B also ;-)
>Remem
The point is that when you have 100,000s of records, this grep becomes
really slow?
Any comments?
Thats why I looked for python :)
> that would be
>
> grep -vf B A
>
> and it is a rare use of grep, indeed.
> --
> TZOTZIOY, I speak England very best.
> "Be strict when sending and tolerant when
Christos TZOTZIOY Georgiou wrote:
On Thu, 16 Dec 2004 14:28:21 +, rumours say that [EMAIL PROTECTED]
I challenge you to a benchmark :-)
Well, the numbers I provided above are almost meaningless with such a
small set (and they easily could be reverse, I just kept the
convenient-to-me first run
On Thu, 16 Dec 2004 14:28:21 +, rumours say that [EMAIL PROTECTED]
might have written:
[sf]
Essentially, want to do efficient grep, i..e from A remove those lines which
are also present in file B.
[EMAIL PROTECTED]
>>>You could implement elegantly using the new sets feature
>>>For ref
Christos TZOTZIOY Georgiou wrote:
On Wed, 15 Dec 2004 16:10:08 +, rumours say that [EMAIL PROTECTED]
might have written:
Essentially, want to do efficient grep, i..e from A remove those lines which
are also present in file B.
You could implement elegantly using the new sets feature
For referen
On Wed, 15 Dec 2004 16:10:08 +, rumours say that [EMAIL PROTECTED]
might have written:
>> Essentially, want to do efficient grep, i..e from A remove those lines which
>> are also present in file B.
>
>You could implement elegantly using the new sets feature
>For reference here is the unix way
On Wed, 15 Dec 2004 17:07:37 +0100, rumours say that "Fredrik Lundh"
<[EMAIL PROTECTED]> might have written:
>> Essentially, want to do efficient grep, i..e from A remove those lines which
>> are also present in file B.
>
>that's an unusual definition of "grep"
that would be
grep -vf B A
and it
[Jane Austine]
> fromkeys(open(f).readlines()) and fromkeys(open(f)) seem to be
> equivalent.
Semantically, yes; pragmatically, no, in the way explained before.
> When I pass an iterator instance(or a generator iterator) to the
> dict.fromkeys, it is expanded at that moment,
I don't know what "e
[Fredrik Lundh]
>>> bdict = dict.fromkeys(open(bfile).readlines())
>>>
>>> for line in open(afile):
>>>if line not in bdict:
>>>print line,
>>>
>>>
[Tim Peters]
>> Note that an open file is an iterable object, yielding the lines in
>> the file. The "for" loop exploited that above, bu
[Fredrik Lundh]
>>> bdict = dict.fromkeys(open(bfile).readlines())
>>>
>>> for line in open(afile):
>>>if line not in bdict:
>>>print line,
>>>
>>>
[Tim Peters]
>> Note that an open file is an iterable object, yielding the lines in
>> the file. The "for" loop exploited that above, bu
Tim Peters wrote:
>> bdict = dict.fromkeys(open(bfile).readlines())
>>
>> for line in open(afile):
>>if line not in bdict:
>>print line,
>>
>>
>
> Note that an open file is an iterable object, yielding the lines in
> the file. The "for" loop exploited that above, but fromkeys() can
>
> "sf" == sf <[EMAIL PROTECTED]> writes:
sf> Just started thinking about learning python. Is there any
sf> place where I can get some free examples, especially for
sf> following kind of problem ( it must be trivial for those using
sf> python)
sf> I have files A, and B ea
["sf" <[EMAIL PROTECTED]>]
>> I have files A, and B each containing say 100,000 lines (each
>> line=one string without any space)
>>
>> I want to do
>>
>> " A - (A intersection B) "
>>
>> Essentially, want to do efficient grep, i..e from A remove those
>> lines which are also present in file B.
sf wrote:
Just started thinking about learning python.
Is there any place where I can get some free examples, especially for
following kind of problem ( it must be trivial for those using python)
I have files A, and B each containing say 100,000 lines (each line=one
string without any space)
I want
"sf" <[EMAIL PROTECTED]> wrote:
> I have files A, and B each containing say 100,000 lines (each line=one
> string without any space)
>
> I want to do
>
> " A - (A intersection B) "
>
> Essentially, want to do efficient grep, i..e from A remove those lines which
> are also present in file B.
th
Just started thinking about learning python.
Is there any place where I can get some free examples, especially for
following kind of problem ( it must be trivial for those using python)
I have files A, and B each containing say 100,000 lines (each line=one
string without any space)
I want to do
18 matches
Mail list logo