The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
extract specific data from xml format file. 60doses Shell Programming and Scripting 7 01-15-2008 11:26 PM
Extract lines from a file automatically. Please a Help alexcol Shell Programming and Scripting 8 12-16-2006 01:25 PM
extract some specific text file urgent pls reyazan UNIX for Dummies Questions & Answers 2 10-20-2005 06:36 AM
How do you specific lines in a file? hedgehog001 UNIX for Dummies Questions & Answers 2 08-22-2005 09:04 PM
how to extract a range of lines from a file beilstwh Shell Programming and Scripting 5 07-09-2004 05:20 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-14-2001
Registered User
 

Join Date: May 2001
Location: NY
Posts: 39
Question

hi,

how would i extract a range of lines in a file by using the line number? ex: file contains:

1 title
2 i want
3 this part
4 to be taken out
5 from this file
6 and sent to
7 another file
8 not needed
9 end of file

In this case, i want to copy line number 2 to 7 on a new file.

thanks....
alex
Forum Sponsor
  #2 (permalink)  
Old 05-15-2001
mib mib is offline
Registered User
 

Join Date: Jan 2001
Location: Calicut
Posts: 228
Hope this is not a homework problem.

sed -n '2,7p' filename > tonewfilename



HTH
  #3 (permalink)  
Old 05-15-2001
Registered User
 

Join Date: May 2001
Location: NY
Posts: 39
no, it's not a homework problem. it's a job-related problem
to help filtering data out of big file. i could try this as a work-around for my problem relating my post on May 1st.

Thank you!
alex
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:28 AM.


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

Content Relevant URLs by vBSEO 3.2.0