From: Johann Spies <johann.spies@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: sh - script: how to control the output.
Date: Mon, 2 Nov 2015 15:00:45 +0200 [thread overview]
Message-ID: <CAGZ55DREZR=tC_WQZTsD2rrGnu9YPPXKXBYyH5FWReOJFvjBBw@mail.gmail.com> (raw)
In-Reply-To: <877fm0d5pm.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
>
> You could try out some of the options for the ":results" header
> argument, as described here:
>
> http://orgmode.org/manual/results.html#results
>
>
>
Thanks Myles. After a bit of experimenting I got this to work (I have to
remove the *example* lines to make a table of the output. But that is OK.
#+BEGIN_SRC sh :results verbatim
#!/bin/sh
echo "\d wos.za_wos_subject_percent_v" | psql -h localhost -p 63334
book_citation | sed '1,2d' | \
sed '/[|+]/s/^/|/'| sed -e '/[|+]/s/$/|/'
#+END_SRC
#+results:
#+begin_example
View "wos.za_wos_subject_percent_v"
| Column | Type | Modifiers |
|---------------+---------+-----------|
| id | integer | |
| subject | citext | |
| pubyear | integer | |
| sa_papers | numeric | |
| world_papers | bigint | |
| za_percentage | real | |
| rest | real | |
#+end_example
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
[-- Attachment #2: Type: text/html, Size: 1789 bytes --]
prev parent reply other threads:[~2015-11-02 13:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 7:35 sh - script: how to control the output Johann Spies
2015-11-02 11:02 ` Myles English
2015-11-02 13:00 ` Johann Spies [this message]
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='CAGZ55DREZR=tC_WQZTsD2rrGnu9YPPXKXBYyH5FWReOJFvjBBw@mail.gmail.com' \
--to=johann.spies@gmail.com \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.