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
replacing new lines in all files of a directory containing old lines rooster005 Shell Programming and Scripting 1 03-25-2008 12:38 PM
grepping many values from same files Sreejith_VK Shell Programming and Scripting 2 03-15-2008 05:41 AM
How to delete first 5 lines and last five lines in all text files ragavendran31 Shell Programming and Scripting 10 02-21-2008 04:58 AM
Joining lines from two files - please help chandra004 Shell Programming and Scripting 25 07-26-2006 11:39 PM
Counting lines and files jorge.ferreira UNIX for Dummies Questions & Answers 6 12-11-2003 08:24 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 09-23-2004
Registered User
 

Join Date: Nov 2003
Location: Grimsby
Posts: 17
grepping lines out of files

Hi, I wonder if anyone can help me. I have a file with about 200 lines in it. I am wanting to set up a Count so that it picks out each line at turn and edits the line. However i am having trouble pulling out the specific line. I have a feeling it will be done somehow by a grep -n but what ever i try i can not pick out the line.

Can anyone please point me in the right direction.
Reply With Quote
Forum Sponsor
  #2  
Old 09-23-2004
TioTony's Avatar
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
sed is probably more the command you are looking for. Somthing like sed -n '# p' will probably work (syntax may be slightly off, I am doing it from memory and it has been a while). Just replace # with the line number you are looking for. The nl command may also be useful. It accepts a file and prints it with a line count.
Reply With Quote
  #3  
Old 09-24-2004
Registered User
 

Join Date: Nov 2003
Location: Grimsby
Posts: 17
Thank you for your assistance, your suggestion works fine.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:51 PM.


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