empfile
12345,Mary J,HR
34512,J Smith,Admin
34700,A Ryan,Admin
34900,B Wilson,HR
59000,C Diaz,HR
We want to sort the empfile by department (3rd field)
$sort -t, -k3 empfile
34512,J Smith,Admin
34700,A Ryan,Admin
12345,Mary J,HR
34900,B Wilson,HR
59000,C Diaz,HR
Option -t is to indicate field separator which here is comma
Option -k is the key indicating the position to sort on
Saturday, May 15, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment