emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: "Joseph A. Cua" <jac89@cornell.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: preserve trailing zeros in table output from shell script
Date: Sun, 15 Jul 2012 08:08:43 -0600	[thread overview]
Message-ID: <87394tyv4k.fsf@gmx.com> (raw)
In-Reply-To: <CAN+oPbOo=s266saKMNU3YoyK18YkudrbaNMukg5=aAafoXzg=A@mail.gmail.com> (Joseph A. Cua's message of "Sat, 14 Jul 2012 08:35:21 -0400")

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

"Joseph A. Cua" <jac89@cornell.edu> writes:

> I have a reporting shell script that generates a tab-delimited table.
> Using it within a shell code block, org parses this nicely into an org
> table. But org seems to drop any trailing zeros from numeric cells. My
> reporting script has already done the number formatting, so I want
> trailing zeros preserved (both within org and in html export). What's
> the best way?
>

If you want to return the numbers as strings *and* you want the results
to be captured as an Org-mode table, then you should use the ":results
org" output type so that you have complete control over the table.

For example,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: results-org.org --]
[-- Type: text/x-org, Size: 125 bytes --]


#+begin_src sh :results output org :exports results
  cat <<EOF
  | 1.0000 | 22.000 |
  | 333.00 | 4444.0 |
  EOF
#+end_src

[-- Attachment #3: Type: text/plain, Size: 53 bytes --]


Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

      parent reply	other threads:[~2012-07-15 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-14 12:35 preserve trailing zeros in table output from shell script Joseph A. Cua
2012-07-15  9:16 ` suvayu ali
2012-07-15 14:08 ` Eric Schulte [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

  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=87394tyv4k.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jac89@cornell.edu \
    /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).