|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Display records between two search strings using sed
I have input file like Code:
AAA AAA CCC CCC CCC EEE EEE EEE EEE FFF FFF GGG GGG i was trying to retrieve data between two strings using sed. Code:
sed -n /CCC/,/FFF/p input_file Am getting output like Code:
CCC CCC CCC EEE EEE EEE EEE FFF The above command retrieves the data till to the first occurence of the destination string (i.e., till 1st occurence off FFF record) I need to search the records till last occurence. Expected output is Code:
CCC CCC CCC EEE EEE EEE EEE FFF FFF Plz help on this query. Last edited by Scrutinizer; 07-20-2012 at 07:32 AM.. Reason: code tags |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| query display number lines or records present in file only numeric value -without filename | ksrivani | UNIX for Advanced & Expert Users | 3 | 07-22-2011 03:40 AM |
| Get records that does not contain particular strings | bobbygsk | Shell Programming and Scripting | 1 | 01-14-2011 01:25 PM |
| extract strings from file and display in csv format | grajp002 | Shell Programming and Scripting | 12 | 03-19-2010 01:38 AM |
| how to display records of file | mishra_sk_in | Shell Programming and Scripting | 2 | 06-29-2007 04:43 AM |
| using cat and grep to display missing records | jxh461 | UNIX for Dummies Questions & Answers | 4 | 01-13-2007 08:56 AM |
|
|