EnglishFrenchSpanish

OnWorks favicon

stag-grepp - Online in the Cloud

Run stag-grepp in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command stag-grepp that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


stag-grep - filters a stag file (xml, itext, sxpr) for nodes of interest

SYNOPSIS


stag-grep person -q name=fred file1.xml

stag-grep person 'sub {shift->get_name =~ /^A*/}' file1.xml

stag-grep -p My::Foo -w sxpr record 'sub{..}' file2

USAGE


stag-grep [-p|parser PARSER] [-w|writer WRITER] NODE -q tag=val FILE

stag-grep [-p|parser PARSER] [-w|writer WRITER] NODE SUB FILE

stag-grep [-p|parser PARSER] [-w|writer WRITER] NODE -f PERLFILE FILE

DESCRIPTION


parsers an input file using the specified parser (which may be a built in stag parser,
such as xml) and filters the resulting stag tree according to a user-supplied subroutine,
writing out only the nodes/elements that pass the test.

the parser is event based, so it should be able to handle large files (although if the
node you parse is large, it will take up more memory)

ARGUMENTS


-p|parser FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module

xml assumed as default

-w|writer FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module

-c|count
prints the number of nodes that pass the test

-filterfile|f
a file containing a perl subroutine (in place of the SUB argument)

-q|query TAG1=VAL1 -q|query TAG2=VAL2 ... -q|query TAGN=VALN
filters based on the field TAG

other operators can be used too - eg <, <=, etc

multiple q arguments can be passed in

for more complex operations, pass in your own subroutine, see below

SUB a perl subroutine. this subroutine is evaluated evry time NODE is encountered - the
stag object for NODE is passed into the subroutine.

if the subroutine passes, the node will be passed to the writer for display

NODE
the name of the node/element we are filtering on

FILE
the file to be parser. If no parser option is supplied, this is assumed to a be a stag
compatible syntax (xml, sxpr or itext); otherwise you should parse in a parser name or
a parser module that throws stag events

Use stag-grepp online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    formkiq-core
    formkiq-core
    FormKiQ Core is an Open Source Document
    Management System (DMS), available to
    run as a headless software or with a
    web-based client, deployed to your
    Amazon We...
    Download formkiq-core
  • 2
    Blackfriday
    Blackfriday
    Blackfriday is a Markdown processor
    implemented in Go. It is paranoid about
    its input (so you can safely feed it
    user-supplied data), it is fast, it
    supports c...
    Download Blackfriday
  • 3
    QNAP NAS GPL Source
    QNAP NAS GPL Source
    GPL source for QNAP Turbo NAS.
    Audience: Developers. User interface:
    Web-based. Programming Language: C,
    Java. Categories:System, Storage,
    Operating System Ker...
    Download QNAP NAS GPL Source
  • 4
    deep-clean
    deep-clean
    A Kotlin script that nukes all build
    caches from Gradle/Android projects.
    Useful when Gradle or the IDE let you
    down. The script has been tested on
    macOS, but ...
    Download deep-clean
  • 5
    Eclipse Checkstyle Plug-in
    Eclipse Checkstyle Plug-in
    The Eclipse Checkstyle plug-in
    integrates the Checkstyle Java code
    auditor into the Eclipse IDE. The
    plug-in provides real-time feedback to
    the user about viol...
    Download Eclipse Checkstyle Plug-in
  • 6
    AstrOrzPlayer
    AstrOrzPlayer
    AstrOrz Player is a free media player
    software, part based on WMP and VLC. The
    player is in a minimalist style, with
    more than ten theme colors, and can also
    b...
    Download AstrOrzPlayer
  • More »

Linux commands

Ad