|
Re: sed to output blocks , which contain a pattern: msg#00062editors.sed.user
On Thu, 15 Dec 2005 16:45:04 +0800, Siva Senthil Kumaran <msivask@xxxxxxxxx> wrote: > > Hi Friends, > > I need a help in using the sed . > > Objective is to search and output the block which contains a pattern > inside > the block. > > I have a block eg. > > BEGIN > aaaa > bbbb > ccc > ddd > END > BEGIN > aaaa > bbbb > ddd > END > BEGIN > aaaa > bbbb > ddd > END > > I need to output the block ( from BEGIN to END ) which contains the > pattern > "ccc" in it , hence I need the out put to be > > > BEGIN > aaaa > bbbb > ccc > ddd > END > sed -n ' /BEGIN/{ :a # \ $b # | N # | read block /END$/!ba # / /ccc/p # output the block, if "ccc" is there }' -- hq00e ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income homes are not online. Make a difference this holiday season! http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/dkFolB/TM --------------------------------------------------------------------~-> -- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/sed-users/ <*> To unsubscribe from this group, send an email to: sed-users-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Bug on GNUWin32 sed 4.1.4: 00062, hq00e |
|---|---|
| Next by Date: | Re: sed users on frappr: 00062, Sven Guckes |
| Previous by Thread: | Re: sed to output blocks , which contain a patterni: 00062, gudermez |
| Next by Thread: | Bug on GNUWin32 sed 4.1.4: 00062, hq00e |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |