The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-06-2008
vgersh99's Avatar
vgersh99 vgersh99 is offline
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
assuming numberList is a file containing 'numbers' to be filtered - one number per line.
And 'myFile' is a file to check the numbers against.

nawk -f simha.awk numberList myFile

simha.awk:
Code:
NR==FNR { numList[$1]; next}
$1 in numList {print $1}
Reply With Quote