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 the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 03-12-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is online now Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,407
Quote:
Originally Posted by Mayuri P R View Post
Thanks alot. Its working fine with the current scenario...

I have one more query. If we know exactly which row to retrieve then this will work fine. Suppose the given dat file contains thousands of records, I just want to retrieve all the rows whose salary is greater tha 15000. How can v acheive that ? In other words can v use expressions(logical,arthmetic, regular...) to retireve the particular rows along with the column name..
yes you can

Code:
 
awk 'BEGIN{NR==1{print}$3>15000{print}' filename