emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* data tables produced by shell source block
@ 2014-03-12 20:08 Ken Mankoff
  2014-03-12 20:19 ` Ken Mankoff
  2014-03-12 20:40 ` Thomas S. Dye
  0 siblings, 2 replies; 3+ messages in thread
From: Ken Mankoff @ 2014-03-12 20:08 UTC (permalink / raw)
  To: org mode


The babel sh example here:
http://orgmode.org/worg/org-contrib/babel/intro.html#source-code-execution
 
says (and shows), "Babel automatically converts the output into an
Org-mode table.". When I run that same code 

#+name: directories
#+begin_src sh :results replace
  cd ~ && du -sc * |grep -v total
#+end_src

I do not get a table. Rather, I get the results in two columns and a
"#+begin_example"

#+RESULTS: directories
#+begin_example
<etc>

Can anyone provide a working example for generating a table in shell
mode that can then be used with Python code?

Thanks,

  -k.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: data tables produced by shell source block
  2014-03-12 20:08 data tables produced by shell source block Ken Mankoff
@ 2014-03-12 20:19 ` Ken Mankoff
  2014-03-12 20:40 ` Thomas S. Dye
  1 sibling, 0 replies; 3+ messages in thread
From: Ken Mankoff @ 2014-03-12 20:19 UTC (permalink / raw)
  To: org mode


Ohp. Nevermind. Sorry for the noise. I have a default of ":results
output", and when I set ":results value" it works.

  -k.


On 2014-03-12 at 16:08, Ken Mankoff wrote:
> The babel sh example here:
> http://orgmode.org/worg/org-contrib/babel/intro.html#source-code-execution
>  
> says (and shows), "Babel automatically converts the output into an
> Org-mode table.". When I run that same code 
>
> #+name: directories
> #+begin_src sh :results replace
>   cd ~ && du -sc * |grep -v total
> #+end_src
>
> I do not get a table. Rather, I get the results in two columns and a
> "#+begin_example"
>
> #+RESULTS: directories
> #+begin_example
> <etc>
>
> Can anyone provide a working example for generating a table in shell
> mode that can then be used with Python code?
>
> Thanks,
>
>   -k.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: data tables produced by shell source block
  2014-03-12 20:08 data tables produced by shell source block Ken Mankoff
  2014-03-12 20:19 ` Ken Mankoff
@ 2014-03-12 20:40 ` Thomas S. Dye
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas S. Dye @ 2014-03-12 20:40 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: org mode

Aloha Ken,

Running emacs -Q, initialized to point to an up-to-date Org mode, this
works for me.

I evaluate this source code block so babel recognizes shell source code
blocks:

#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((sh . t)))
#+END_SRC

#+RESULTS:
| (sh . t) |

Then run the directories source code block to get this:

#+RESULTS: directories
|       184 | Documents                  |
|    548528 | Downloads                  |
|   3852088 | Library                    |
|  10208696 | Mail                       |
|         0 | Movies                     |
...

Perhaps you have something in an initialization file?

hth,
Tom

Ken Mankoff <mankoff@gmail.com> writes:

> The babel sh example here:
> http://orgmode.org/worg/org-contrib/babel/intro.html#source-code-execution
>  
> says (and shows), "Babel automatically converts the output into an
> Org-mode table.". When I run that same code 
>
> #+name: directories
> #+begin_src sh :results replace
>   cd ~ && du -sc * |grep -v total
> #+end_src
>
> I do not get a table. Rather, I get the results in two columns and a
> "#+begin_example"
>
> #+RESULTS: directories
> #+begin_example
> <etc>
>
> Can anyone provide a working example for generating a table in shell
> mode that can then be used with Python code?
>
> Thanks,
>
>   -k.
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-12 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 20:08 data tables produced by shell source block Ken Mankoff
2014-03-12 20:19 ` Ken Mankoff
2014-03-12 20:40 ` Thomas S. Dye

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).