The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Display Serial Number dkranes SUN Solaris 5 05-16-2008 09:38 AM
How print number bisla.yogender Shell Programming and Scripting 4 04-28-2008 06:51 AM
to print number one less than actual number cdfd123 Shell Programming and Scripting 4 09-06-2007 06:56 AM
How to use ps to display processor number tumblez UNIX for Dummies Questions & Answers 1 04-04-2007 07:31 AM
How to print at a specific position of the display efernandes Shell Programming and Scripting 1 01-23-2007 08:08 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-05-2008
jerardfjay jerardfjay is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 146
print or display certain number of file

Hi,

I am sure this is possible in awk or sed or a combination of the two.
Can someone help me determine the best way to display or print certain section of a file, ie only certain number of lines.

Example: File1 1 has 20 lines.
I need to be able to print from line 5 to line 10 of this file.

How can I get this done.

I know sed -n '5 p' File1 will get me the 5 line.
However I need a range of lines from this file.
Please let me know how to do this

Thx
  #2 (permalink)  
Old 04-05-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
One way:
Code:
sed -n '5,10p' file1
  #3 (permalink)  
Old 04-05-2008
jerardfjay jerardfjay is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 146
One way

Jim,

Thanks. Works like a charm.

Regards,
Francis
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0