http://qs321.pair.com?node_id=795696


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; }