![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| command for selecting specific lines from a script | gardasgangadhar | UNIX for Dummies Questions & Answers | 1 | 05-13-2008 02:29 AM |
| Urgent: selecting unique specific content of a file using shell script | jisha | Shell Programming and Scripting | 2 | 01-08-2008 04:45 AM |
| replacing specific lines in a file | hcclnoodles | Shell Programming and Scripting | 6 | 09-30-2006 08:35 AM |
| remove specific lines from a file | hcclnoodles | Shell Programming and Scripting | 14 | 09-07-2006 09:31 AM |
| How do you specific lines in a file? | hedgehog001 | UNIX for Dummies Questions & Answers | 2 | 08-22-2005 09:04 PM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Help with selecting specific lines in a large file
Hello,
I need to select the 3 lines above as well as below a search string, including the search string. I have been trying various combinations using sed command without any success. Can anuone help please. Thanking |
| Forum Sponsor | ||
|
|
|
|||
|
Hello, Thanks for the reply.
But I don't think I can use grep as I don't know what are the data block in between teh search string. My file layout is as follows: ------------------------------ Data (numerous lines) ------------------------------ Data (numerous lines) ------------------------------ Data (numerous lines) ------------------------------ Data (numerous lines) And so on. I only need to get the 3 lines above and below the ----------- as well as the ------------- Thanks for any assistance . |
|||
| Google UNIX.COM |