![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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
|
|||
|
|||
|
Thank you for your assistance, your suggestion works fine.
|
|||
| Google The UNIX and Linux Forums |