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 -->
  #1 (permalink)  
Old 03-12-2009
Mayuri P R Mayuri P R is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 3
Retrieving particular row from a dat file

Hi..

I have a dat file containing both column names and data. Now I want to get only Particular row along with the column names.
My dat fiel is as below

EmpName Dept Salary
Shally Admin 20000
Swati HR 15000
Deepali IT 45000
Preetika EEE 60000

Now I want to display only row 3rd along with column name using awk command.

I tried as below to get the column name ;
awk 'NR==1 {print $0}' Employee.dat
This retrives the column name... now how to get particular row.