[XML-SIG] Useless fun thing for XML - comments or helpers?
Markus Fleck
fleck@informatik.uni-bonn.de
Thu, 03 Sep 1998 18:19:26 +0200
Fredrik Lundh wrote:
> >I suggest we keep it all very simple for now! Even as it stands a tool like
> >sgrep - structured grepping - really shows up the advantage of XBEL.
>
> sgrep? Is this an existing utility? Where do I find it?
"sgrep" allows for the definition of "regions" of text, which may
then be searched selectively. For example, I use the following
"sgrep" macros to split the text-only version of the Python FAQ
(the version that gets posted to comp.lang.python.announce) into
sections:
--- CUT ---
define(FAQ1, (("1" in "\n\n1. ") .. ( "-\n\n" in "-\n\n2. ") ))
define(FAQ2, (("2" in "\n\n2. ") .. ( "-\n\n" in "-\n\n3. ") ))
define(FAQ3, (("3" in "\n\n3. ") .. ( "-\n\n" in "-\n\n4. ") ))
define(FAQ4, (("4" in "\n\n4. ") .. ( "-\n\n" in "-\n\n5. ") ))
define(FAQ5, (("5" in "\n\n5. ") .. ( "-\n\n" in "-\n\n6. ") ))
define(FAQ6, (("6" in "\n\n6. ") .. ( "-\n\n" in "-\n\n7. ") ))
define(FAQ7, (("7" in "\n\n7. ") .. ( "-\n\n" in "-\n\n8. ") ))
define(FAQ8, (("8" in "\n\n8. ") .. (("-\n\n" in "-\n\n1. ") or end) ))
--- CUT ---
Invoking "sgrep FAQ2 FAQ.txt" would then spit out section 2 of the FAQ.
You can also use "sgrep" to search only "Subject: " fields in mail
headers of a mailbox file, or only <H1>-tagged text in an HTML file.
"sgrep" can be found at <http://www.cs.helsinki.fi/~jjaakkol/sgrep.html>.
Yours,
Markus.
--
////////////////////////////////////////////////////////////////////////////
Markus B Fleck - University of Bonn - CS Department IV - fleck@isoc.de
UNIX Administrator - comp.lang.python.announce Moderator
PINN Open Source Internet Groupware Project - http://cscw.net/pinn/
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\