Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: Faster grep in a huge file(10 million)

by Thomas Kennll (Acolyte)
on May 10, 2013 at 20:09 UTC ( #1033020=note: print w/replies, xml ) Need Help??

in reply to Re: Faster grep in a huge file(10 million)
in thread Faster grep in a huge file(10 million)

Thanks for the reply. I tried this but, doesn't seem to help . :(
#!/usr/bin/perl use strict; use warnings; my %file2; open my $file2, '<', '/home/match_miss' or die "Couldn't open file2: $ +!"; while ( my $line = <$file2> ) { ++$file2{$line}; } open my $file1, '<', '/home/BIG_FILE' or die "Couldn't open file1: $!" +; while ( my $line = <$file1> ) { print $line if defined $file2{$line}; }

Replies are listed 'Best First'.
Re^3: Faster grep in a huge file(10 million)
by Cristoforo (Curate) on May 10, 2013 at 22:34 UTC
    print $line if defined $file2{$line};
    I think that finds lines in file 1 that are also in file 2. To find lines in file 1 not in file 2, maybe change that to:

    print $line unless defined $file2{$line};

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033020]
[Discipulus]: what i want is to compute them
[oiskuu]: You want to draw the path? $iter = combinations( $TOP_HEIGHT .. $NODE_HEIGHT, $pos); then get the path from the iter, level change at depth x, for(..) $pos += $level_change; something like that
[oiskuu]: yergh, <code> tags... [$top_height .. $node_height]
[Eily]: Discipulus by demonstrate I suppose you mean simulate with perl?
[Eily]: the demonstration itself is fairly easy. The number of paths on a node is the sum of the numbers of paths to the two nodes above (or one node above on the edges of the triangle)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2018-03-19 11:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.