in reply to Parsing a Flat File and counting occurances of numbers?

The following one-liner would do it. (Wrapped for posting. Quotes are shell dependant.)

perl -nwle"/bn(\d{4})/ && $1 >= 4000 && $1 <=6200 && ++$c{ $1 };" -e"END{ print qq[$_ => $c{ $_ }] for sort keys %c}" temp.dat 4370 => 1 4512 => 1 5600 => 2 6042 => 1 6085 => 2

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.