From: Roland Everaert <reveatwork@gmail.com>
To: Eric S Fraga <e.fraga@ucl.ac.uk>, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: org babel table header sent to awk code block
Date: Fri, 17 Feb 2017 16:00:52 +0100 [thread overview]
Message-ID: <CACdPZ9KB-HGjvuHUZUUggETh9qMPA2ZJofiUvK_hJ+9LfduTxQ@mail.gmail.com> (raw)
In-Reply-To: <87shndc6cb.fsf@ucl.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]
I see that more or less 30 seconds after posting to the ML :/
So the problem of this script is solved.
But anyway, why are column headers sent to the script, even with :hlines
and/or :colnames set approriately?
Thanks.
On Fri, Feb 17, 2017 at 2:08 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
> On Friday, 17 Feb 2017 at 12:33, Roland Everaert wrote:
> > Hi,
> >
> > I am trying to filter a table using the following awk code block.
>
> I think your problem is an error in the awk script; specifically, the
> match is outputting all lines because you need to have the { on the same
> line as the match expression. Try this:
>
> #+BEGIN_SRC awk :stdin list-example :var fstcol=1 :var seccol=3 :results
> output org
> BEGIN {
> print "|Host|Result"
> print "|-"
> }
> $seccol ~ /[0-9]{1,3}(\.[0-9]\{1,3\}){3}/ {
> print "|"$fstcol"|"$seccol
> }
> #+END_SRC
>
> You may have noticed that the second line (which had an empty third
> column so should not have matched) was also being output when it
> shouldn't have.
>
> In any case, the above works for me.
>
> HTH,
> eric
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8
>
[-- Attachment #2: Type: text/html, Size: 1792 bytes --]
next prev parent reply other threads:[~2017-02-17 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48db0e51591f4ff180507a99ea72ad5a@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-02-17 13:08 ` org babel table header sent to awk code block Eric S Fraga
2017-02-17 15:00 ` Roland Everaert [this message]
2017-02-17 12:33 Roland Everaert
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACdPZ9KB-HGjvuHUZUUggETh9qMPA2ZJofiUvK_hJ+9LfduTxQ@mail.gmail.com \
--to=reveatwork@gmail.com \
--cc=e.fraga@ucl.ac.uk \
--cc=emacs-orgmode@gnu.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).