Re: Help with sorting another file


Subject: Re: Help with sorting another file
From: Arthur Corliss (acorliss@nevaeh-linux.org)
Date: Thu Feb 26 2004 - 11:42:40 AKST


On Thu, 26 Feb 2004, David J. Weller-Fahy wrote:

<snip> Good explanation, David, thanks! I should point out that I tested the
line by taking the examples I had in e-mail, munging up a couple of copies of
the blocks, and putting them into a test file. Worked fine. However, having
never seen the file they come in, there's a few caveats to be aware of:

  --I probably shouldn't have put the caret before '<programme', since
    it may be your <programme> entries have preceding whitespace
  --If you have other pertinent blocks of text that may need to be
    preserved (i.e, xml body tags, non-programme blocks, etc.) then
    this needs to be modified to preserve those as well.

In short, the example I provided is good for only one thing: print programme
blocks that have both start and stop times in it from a file with nothing but
programme blocks. But it can easily be modified to do much more.

The neat thing is that sed makes a great data extraction tool for XML. For
functions like this I find using validating XML parsers to be a tad overkill.

        --Arthur Corliss
          Bolverk's Lair -- http://arthur.corlissfamily.org/
          Digital Mages -- http://www.digitalmages.com/
          "Live Free or Die, the Only Way to Live" -- NH State Motto
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Thu Feb 26 2004 - 11:43:11 AKST