The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
Awk - select from a list
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Forum Rules
FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
Awk - select from a list
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
02-06-2008
vgersh99
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}
vgersh99
View Public Profile
Find all posts by vgersh99