Re: sed problem...simpler solution?

From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 02/28/04


Date: Sat, 28 Feb 2004 01:28:19 GMT

On Sat, 28 Feb 2004 00:20:01 +0000, Carlos J. G. Duarte <cjgd@clix.pt> wrote:
>
>
> Mike Chirico wrote:
>> Using sed, how do I print contents between delimiters
>> <start> and <stop> if these delimiters sometimes occur on the same line?
>> It's ok to include <start> and <stop> in the output.
>
> 1. search for start
> 2. print
> 3. found stop? no: goto 2; yes goto 1
>
> sed -n '/<start>/!d; :b; p; /<stop>/d; n; bb'
>

A very nice script.

I learned a lot from studying it.

AC



Relevant Pages

  • Re: Change the Delimiters
    ... recursive descent parsing to find all the delimiters in most general case. ... The script can be easily modified to do the kind of replacement you want. ... double quotation marks and do the replacement accordingly. ... > search/replace may suffice. ...
    (microsoft.public.sqlserver.clients)
  • Re: Exporting from Calendar to a CSV file
    ... here's a script that will save the data to a tab delimited text file ... set {oldTIDS, AppleScript's text item delimiters} to ¬ ... {AppleScript's text item delimiters, {", "}} ... set eventData to {mysub:subject, myST:start time, myET:end time, ...
    (microsoft.public.mac.office.entourage)
  • Re: How to just grab email addresses?
    ... To get ONLY the default email address, you'd have to do it by script: ... set theContacts to ... set end of eAddresses to default email address of theContact ... set AppleScript's text item delimiters to ...
    (microsoft.public.mac.office.entourage)
  • Re: missing ) after argument list
    ... > W3 document: HTML comments have the following syntax: ... `script' element's content, however, is CDATA in HTML. ... that resembles delimiters of a _markup_ language. ... if the content was declared CDATA using the respective XML declaration as ...
    (comp.lang.javascript)
  • Re: How to just grab email addresses?
    ... To get ONLY the default email address, you'd have to do it by script: ... set theContacts to ... set end of eAddresses to default email address of theContact ... set AppleScript's text item delimiters to ...
    (microsoft.public.mac.office.entourage)