Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Searching and Coutning using 2 files with multiple columns

by ccn (Vicar)
on Sep 16, 2009 at 18:51 UTC ( #795696=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Searching and Coutning using 2 files with multiple columns
in thread Searching and Coutning using 2 files with multiple columns

Hmm... It works for me as desired on your sample data.

What delimiters do you use between columns? What is your OS?

Please try this one:

#!/usr/bin/perl -lan BEGIN { die "Usage: $0 Boundary.out DB.out" unless @ARGV == 2; } if ( $isDB ) { print join "\t", @F, ~~grep { $_->[0] > $F[2] && $_->[1] < $F[3] } @{$chr{$F[1]}} } else { push @{$chr{$F[0]}}, [ @F[1, 2] ]; $isDB = eof; }


Comment on Re^3: Searching and Coutning using 2 files with multiple columns
Download Code
Replies are listed 'Best First'.
Re^4: Searching and Coutning using 2 files with multiple columns
by shart3 (Novice) on Sep 17, 2009 at 15:27 UTC

    Thanks. PROBLEM SOLVED!! Your original post worked! I had to remove a hard return in my text file that was screwing everything up

      OK. And now you have a challenge to understand why does it work. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://795696]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (15)
As of 2015-07-07 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls