LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-04-2012, 04:28 PM   #1
sparker1970
LQ Newbie
 
Registered: Apr 2012
Location: Warren, MI
Posts: 4

Rep: Reputation: Disabled
Extract a Sequence of lines from a Text File


I have a text file 205,383 lines long and I need to extract the data in every 921st line beginning at line 8. Unfortunately this is how we get it from our client.

I have recently been introduced to Linux and am pretty confident it is capable of what I need to do.

Thanks in advance....Steve
 
Old 04-04-2012, 04:31 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Try the following:

Code:
sed -n '8~921p' file
 
1 members found this post helpful.
Old 04-04-2012, 09:56 PM   #3
sparker1970
LQ Newbie
 
Registered: Apr 2012
Location: Warren, MI
Posts: 4

Original Poster
Rep: Reputation: Disabled
Worked perfectly. Thank you very much. I am a Linux newbie (2 weeks) but a believer.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sed use - extract substring from lines of text file tastiero Linux - Newbie 26 03-12-2012 04:10 AM
How to extract lines from file using AWK keenboy Linux - General 7 08-05-2010 08:29 AM
[SOLVED] Extract multiple lines of data from a text file. shawnamiller Programming 8 04-30-2010 11:46 AM
Extract lines NOT on a block of text from a file Renan_S2 Programming 3 10-05-2008 04:14 PM
how to extract certain lines from a log file Avatar Linux - Newbie 3 02-11-2005 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration