|
Re: Stingily extracting a block of lines: msg#00014editors.sed.user
Rachel Cogent wrote: > I want to extract a range of lines beginning with the word 'bundle' and > ending with the word '.eml,'. The 'bundle' delimiter will occur > repeatedly throughout the file, so I want to use the most recent instance > (greedy). > > How would I do it using sed? You're being too vague. Guessing that your data looks like the beginning foo foo bundle bar 1 bar baz foo bundle baz 2 noise noise bar .elm noise the end Then the sed script is simply: sed -n '/bundle/,/\.elm/p' input.txt > output.txt Angus ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/I258zB/QnQLAA/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: | Stingily extracting a block of lines: 00014, Rachel Cogent |
|---|---|
| Next by Date: | Simple Conditional execution in a script: 00014, crmuser1998 |
| Previous by Thread: | Stingily extracting a block of linesi: 00014, Rachel Cogent |
| Next by Thread: | Re: Stingily extracting a block of lines: 00014, Angus Leeming |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |