if the data file sizes are not huge, there is a simpler way
$ join input1 input2 | awk '$5<$4 && $3<$5 {print $2, $5-$3+1}'
B100002 32
B100043 15
B123465 3
More Related Contents:
- How to use shell variables in perl command call in a bash shell script?
- how to print n words of context while searching text [closed]
- What is meaning of defined keyword [closed]
- Iterating through a CSV and pulling out the last line of the day for each element
- how to check if a number is whole number or contains a decimal
- How can i do this in perl, shortcut truthtable [closed]
- Failing to install MIME::Base64 using cpan [closed]
- Awk – replace coumn 2 in table 1 from coumn 2 in table 2 based on matching data in column 1 (common between tables)
- Why can’t Perl find my file that is in ClearCase?
- How can I install a CPAN module into a local directory?
- How can I use CPAN as a non-root user?
- Perl daemonize with child daemons
- What’s the difference between a hash and hash reference in Perl?
- Multiline search replace with Perl
- How can I process options using Perl in -n or -p mode?
- Using perl’s `system`
- What’s the best way to open and read a file in Perl?
- How do I daemonize an arbitrary script in unix?
- How can I dynamically include Perl modules without using eval?
- How can I store the result of a system command in a Perl variable?
- How can I check if a file exists in Perl?
- Using Encode::encode with “utf8”
- How can I start an interactive console for Perl?
- What does =~ do in Perl? [closed]
- How to convert letters with accents, umlauts, etc to their ASCII counterparts in Perl?
- What does shift() do in Perl?
- How can I extract text from a PDF file in Perl?
- How do I retrieve the terminal width in Perl?
- How to make DateTime::Duration output only in days?
- How do I tell CPAN to install all dependencies?