The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
seperating records with numbers from a set of numbers
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
seperating records with numbers from a set of numbers
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
11-25-2008
mk1216
Registered User
Join Date: Sep 2008
Location: Bristol , United Kingdom
Posts: 38
$> cat data.dat
1,3,4,
m,h,j
4,5,h
h,t,y
r,t,b
3,f,r
$> cat numbers.dat
1
2
3
4
5
for i in `cat numbers.dat`
do
cat data.dat|awk -F"," '{if($1==number) print $0}' number="$i"
done
OUTPUT
1,3,4,
3,f,r
4,5,h
mk1216
View Public Profile
Find all posts by mk1216
Find mk1216's past nominations received
Find mk1216's present nominations given