Re: Using sed for multiline matching
- From: yard-ape <yard-ape@xxxxxxxxx>
- Date: Tue, 15 Dec 2009 22:50:56 GMT
laredotornado wrote:
On Dec 13, 12:35 pm, pk <p...@xxxxxxxxxx> wrote:laredotornado wrote:Ok, I give up. How do you use sed to do a multiline search given ahttp://sed.sourceforge.net/sedfaq4.html#s4.23
regular expression? I don't want to replace anything, just do a
search, much like grep. However, I'm to understand that grep only
searches one line at a time.
after reading that, you'll might think of switching to another tool.
Do you have a suggestion, or even an example, or something else that
can match multi-lines given a regular expression? - Dave
Perl and awk will get the job done, but structural regular expressions is the simplest, cleanest model for this problem:
http://en.wikipedia.org/wiki/Sam_%28text_editor%29
If you need a non-interactive solution, just write the sam commands in some file and do:
$ sam -d file.txt < script.sam
.
- References:
- Using sed for multiline matching
- From: laredotornado
- Re: Using sed for multiline matching
- From: pk
- Re: Using sed for multiline matching
- From: laredotornado
- Using sed for multiline matching
- Prev by Date: Re: Is is OK to unset a variable that is not set ?
- Next by Date: Re: Textfile with unwanted spaces in words
- Previous by thread: Re: Using sed for multiline matching
- Next by thread: The select builtin and white space
- Index(es):
Relevant Pages
|