The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
reading text file line by line MizzGail Shell Programming and Scripting 6 04-14-2008 03:58 AM
Line by line file reading... and more! ProFiction Shell Programming and Scripting 6 07-26-2007 08:32 AM
reading a line into a variable in unix lmadhuri UNIX for Dummies Questions & Answers 1 02-07-2007 07:04 AM
Reading line by line from a file tej.buch Shell Programming and Scripting 2 01-22-2006 11:50 PM
Reading line by line from file. akpopa UNIX for Dummies Questions & Answers 4 08-30-2001 07:20 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-11-2002
Registered User
 

Join Date: Feb 2002
Location: India
Posts: 36
Question Reading Particular Line From A File in Unix

Can any u pls tell me :-

I want to read a particular line from a file, say line no. 10.
This can be done by using awk..but that method I think, is inefficient.
Is there any direct command for this?

Thanks
__________________
Yeheya Ansari
Software Engineer
Forum Sponsor
  #2  
Old 02-11-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Personally, I would use:
sed -n 10p filename
  #3  
Old 02-12-2002
Registered User
 

Join Date: Feb 2002
Location: India
Posts: 36
Thanks For Ur Reply. I will try it.

What I use today is
sed -n "10s/.*/&/p" filename

But ur reply looks really goodone for me.
__________________
Yeheya Ansari
Software Engineer
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0