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 > 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-16-2008 03:26 AM
Extract lines from a file automatically. Please a Help alexcol Shell Programming and Scripting 8 12-16-2006 05:25 PM
extract some specific text file urgent pls reyazan UNIX for Dummies Questions & Answers 2 10-20-2005 09:36 AM
How do you specific lines in a file? hedgehog001 UNIX for Dummies Questions & Answers 2 08-23-2005 12:04 AM
how to extract a range of lines from a file beilstwh Shell Programming and Scripting 5 07-09-2004 08:20 AM

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 05-14-2001
apalex apalex is offline
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
  #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
apalex apalex is offline
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
Sponsored Links
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 10:18 PM.


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