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 Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 03:38 PM
grepping many values from same files Sreejith_VK Shell Programming and Scripting 2 03-15-2008 08: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 07:58 AM
Joining lines from two files - please help chandra004 Shell Programming and Scripting 25 07-27-2006 02:39 AM
Counting lines and files jorge.ferreira UNIX for Dummies Questions & Answers 6 12-11-2003 11:24 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 09-23-2004
mariner mariner is offline
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.
  #2 (permalink)  
Old 09-23-2004
TioTony's Avatar
TioTony TioTony is offline Forum Advisor  
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.
  #3 (permalink)  
Old 09-24-2004
mariner mariner is offline
Registered User
  
 

Join Date: Nov 2003
Location: Grimsby
Posts: 17
Thank you for your assistance, your suggestion works fine.
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 07:22 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