The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Tyler Adams <coppero1237@gmail.com>
To: arnold@skeeve.com
Cc: tuhs@tuhs.org
Subject: Re: [TUHS] Tech Sq elevator (Was: screen editors) [ really I think efficiency now ]
Date: Wed, 22 Jan 2020 09:29:43 +0200	[thread overview]
Message-ID: <CAEuQd1CPaY9OnCrkbwPXyGqUAryPY-xXzSg+WiOeHNpet7EZQA@mail.gmail.com> (raw)
In-Reply-To: <202001220721.00M7Ll5D021031@freefriends.org>

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

Also for anything where jq gets too complicated, you can use python to whip
up an arbitrary json filter

Theres only 5 lines of boiler plate

import json
import sys
d = json.load(sys.stdin)
# your code here
print(json.dumps(d))

Tyler

On Wed, Jan 22, 2020, 09:22 <arnold@skeeve.com> wrote:

> > On Sat, Jan 18, 2020 at 09:45:22AM -0600, Michael Parson wrote:
> > >
> > > And here, understanding the model is important, namely, grep is the
> > > wrong tool for searching/parsing JSON output. Dealing with JSON from
> the
> > > shell, you should use jq.  I've been dragged kicking and screaming into
> > > dealing with JSON, and about all I can say about it is, I like it about
> > > this >< much more than XML. :)
>
> Derek Fawcus <dfawcus+lists-tuhs@employees.org> wrote:
> > If push comes to shove, one can always use xmlawk (xml extension for
> gawk)
> > to beat the latter in to submission.
>
> There is also a simple JSON extension for gawk in the gawkextlib project
> that can suck in a single JSON record and turn it into a gawk
> multidimensional array, and vice versa.  (Gawk has true multidimensional
> arrays and isarray/typeof functions so that you can easily traverse
> such an array.)
>
> (<horn ownership="mine">Toot!</horn>)
>
> Arnold
>

[-- Attachment #2: Type: text/html, Size: 1987 bytes --]

  reply	other threads:[~2020-01-22  7:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12 13:43 [TUHS] Tech Sq elevator (Was: screen editors) Doug McIlroy
2020-01-12 16:56 ` Warner Losh
2020-01-12 17:21   ` markus schnalke
2020-01-12 20:25   ` Kevin Bowling
2020-01-12 20:32     ` Larry McVoy
2020-01-12 20:34     ` Jon Steinhart
2020-01-12 20:40       ` Kevin Bowling
2020-01-12 20:44         ` Jon Steinhart
2020-01-12 21:03           ` Kevin Bowling
2020-01-12 21:37             ` [TUHS] Tech Sq elevator (Was: screen editors) [ really I think efficiency now ] Jon Steinhart
     [not found]               ` <CAEoi9W4fXLaTRM1mv4wnVbifCFBEw_iKL9cds8ds-FBRTwM-=g@mail.gmail.com>
     [not found]                 ` <CAEoi9W6LedGGjWPO=ZgZzVdGLqs8drhqcWkvA_DfKTOtMDgegQ@mail.gmail.com>
2020-01-13 23:46                   ` Dan Cross
2020-01-14 23:17                     ` Kevin Bowling
2020-01-18 15:45                     ` Michael Parson
2020-01-18 18:45                       ` Jon Steinhart
2020-01-18 18:59                         ` Michael Parson
2020-01-18 20:31                           ` Adam Thornton
2020-01-21 21:57                       ` Derek Fawcus
2020-01-22  7:21                         ` arnold
2020-01-22  7:29                           ` Tyler Adams [this message]
2020-01-12 21:41           ` [TUHS] Tech Sq elevator (Was: screen editors) Bakul Shah
2020-01-12 21:47             ` Jon Steinhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEuQd1CPaY9OnCrkbwPXyGqUAryPY-xXzSg+WiOeHNpet7EZQA@mail.gmail.com \
    --to=coppero1237@gmail.com \
    --cc=arnold@skeeve.com \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).