in reply to Re^2: Compare fields in a file
in thread Compare fields in a file

Actually, there is a subtle difference: yours outputs an empty string for the elements which should be discarded. When printing this doesn't matter, but when saving it into an array, you will have lots of empty elements sprinkled through the array. Hence my use of grep which doesn't output anything if the value of its block is false.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James