emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Influence the table separator in a code block
@ 2021-07-13 10:06 Wiktor Kwapisiewicz
  2021-07-14  3:27 ` Greg Minshall
  0 siblings, 1 reply; 2+ messages in thread
From: Wiktor Kwapisiewicz @ 2021-07-13 10:06 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm using #+BEGIN_SRC sh code blocks and org-mode nicely renders the
output as a table:

#+BEGIN_SRC sh
  echo FIRST   SECOND   THIRD
  echo first second third
#+END_SRC

#+RESULTS:
| FIRST | SECOND | THIRD |
| first | second | third |

And this is very nice. Unfortunately the autodetection breaks when any
item contains a comma (,):

#+BEGIN_SRC sh
  echo FIRST   SECOND   THIRD
  echo first second third,d
#+END_SRC

#+RESULTS:
| FIRST SECOND THIRD |   |
| first second third | d |

I tried to force org to use spaces by using "sep". Unfortunately this
doesn't work:

#+BEGIN_SRC sh :sep " "
  echo FIRST   SECOND   THIRD
  echo first second third,d
#+END_SRC

#+RESULTS:
| FIRST SECOND THIRD |   |
| first second third | d |

Is there a way to force org to split on spaces even when commas are in
the output?

Thank you in advance for help!

Kind regards,
Wiktor


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

* Re: Influence the table separator in a code block
  2021-07-13 10:06 Influence the table separator in a code block Wiktor Kwapisiewicz
@ 2021-07-14  3:27 ` Greg Minshall
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Minshall @ 2021-07-14  3:27 UTC (permalink / raw)
  To: Wiktor Kwapisiewicz; +Cc: emacs-orgmode

fwiw, this may depend on the source language (rather than -- solely? --
on org interpretation of the output block:

#+begin_src R
  data.frame(a=c("this", "is", "a", "test"), b=c("tset", "a", "si", "oot, siht"))
#+end_src

#+RESULTS:
| this | tset      |
| is   | a         |
| a    | si        |
| test | oot, siht |


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

end of thread, other threads:[~2021-07-14  3:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-13 10:06 Influence the table separator in a code block Wiktor Kwapisiewicz
2021-07-14  3:27 ` Greg Minshall

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