From mboxrd@z Thu Jan 1 00:00:00 1970 From: sergio ruiz Subject: Inserting a row divider/header into org-babel results Date: Tue, 14 Jan 2020 16:01:45 -0500 Message-ID: <929AA126-B482-4D29-A37B-B538D4A4CDB0@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: multipart/signed; boundary="Apple-Mail=_72246CCC-3E94-4AD3-B07D-7282944672CB"; protocol="application/pgp-signature"; micalg=pgp-sha256 Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:38500) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irTJw-0007EW-J0 for emacs-orgmode@gnu.org; Tue, 14 Jan 2020 16:01:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irTJv-0003Nm-5v for emacs-orgmode@gnu.org; Tue, 14 Jan 2020 16:01:52 -0500 Received: from mail-il1-x144.google.com ([2607:f8b0:4864:20::144]:42745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irTJu-0003M3-Rh for emacs-orgmode@gnu.org; Tue, 14 Jan 2020 16:01:51 -0500 Received: by mail-il1-x144.google.com with SMTP id t2so12808806ilq.9 for ; Tue, 14 Jan 2020 13:01:50 -0800 (PST) Received: from [192.168.20.185] (rrcs-24-106-142-62.central.biz.rr.com. [24.106.142.62]) by smtp.googlemail.com with ESMTPSA id v7sm3794593iom.58.2020.01.14.13.01.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2020 13:01:47 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --Apple-Mail=_72246CCC-3E94-4AD3-B07D-7282944672CB Content-Type: multipart/alternative; boundary="Apple-Mail=_87E103C1-13A0-4406-A159-A5FBC7B30C25" --Apple-Mail=_87E103C1-13A0-4406-A159-A5FBC7B30C25 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Adding a header to the data =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D I am presenting some simple data here, but the idea is, I would like to programatically add a header to the results of an org-babel evaluation. Looking at the results from `data_table', I would like to intercept the first line so that I can massage it into the preferred output. I am just unsure how to insert the header into my output. My goal is to be able to generate the "Preferred result" programatically. Any Ideas? Thanks! Latex Test ~~~~~~~~~~ Table test here: ---------------- ,---- | rows =3D (1..5) | columns =3D (1..5) | results =3D [] | rows.each_with_index do |row| | result_row =3D [] | columns.each do |column| | result_row << column * row | end | results << result_row | end | results `---- 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 Preferred result ---------------- column 1 column 2 column 3 column 4 column 5 -------------------------------------------------- 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 ---- peace, sergio photographer, journalist, visionary Public Key: = https://pgp.key-server.io/pks/lookup?op=3Dget&search=3D0x69B08F58923AB3A2 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV @sergio_101@mastodon.social https://sergio101.com http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 --Apple-Mail=_87E103C1-13A0-4406-A159-A5FBC7B30C25 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Adding a header to the = data
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

  I am presenting some simple data = here, but the idea is, I would like
  to = programatically add a header to the results of an org-babel
  evaluation. Looking at the results from `data_table', = I would like to
  intercept the first line so = that I can massage it into the preferred
  = output. I am just unsure how to insert the header into my = output.

  = My goal is to be able to generate the "Preferred result"
  programatically.

  Any Ideas?

  Thanks!


Latex Test
~~~~~~~~~~

Table test = here:
----------------

  ,----
  = | rows =3D (1..5)
  |   columns =3D = (1..5)
  |   results =3D []
  |   rows.each_with_index do |row|
  |     result_row =3D []
  |     columns.each do |column|
  |       result_row << column * = row
  |     end
  |     results << result_row
  |   end
  |   = results
  `----

   1   2   3   = 4   5 
   2   4   6 =   8  10 
   3   6 =   9  12  15 
   4 =   8  12  16  20 
  =  5  10  15  20  25 

Preferred result
----------------

   column 1  column 2  column 3 =  column 4  column 5 
  = --------------------------------------------------
          2       =   4         6         8 =        10 
    =       3         6     =     9        12       =  15 
          4 =         8        12   =      16        20 
          5       =  10        15        20 =        25 



----
peace,
sergio
photographer, journalist, visionary

Public Key: https://pgp.key-server.io/pks/lookup?op=3Dget&search=3D0x69= B08F58923AB3A2
#BitMessage = BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
https://sergio101.com
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
=

= --Apple-Mail=_87E103C1-13A0-4406-A159-A5FBC7B30C25-- --Apple-Mail=_72246CCC-3E94-4AD3-B07D-7282944672CB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE3eGd4191mOC5vqPaabCPWJI6s6IFAl4eLDkACgkQabCPWJI6 s6J1/A/+JxWhSVDmCCcioyGQBRafyOKrA6KnVDAnxVDzD7IQkiR8PrcGD9cQlk51 Z8gd8+Mst7Owtd99HpM8lha5p1sUkSZZQzerp83hdp5fuaS3UptNbEY9J34qUoCn 1Cl9KgzpY1uCZEaP3Goo9vp7TjWFzx0U/P6AadLBiDzoz551LshoMYqseNFxtp6p 5wqG1rV/kc8FfIkN1lEHmoaKPbJV2at0P9gRRYJqdMdmNUZCfRrdVYZ15lsBC4ai ffN80jBLH64/1md7yfMXLMP2rxfwA14cxNipnZsE+wEzeovQgzobXgKxnIwdH/Hl lFPQUxmeO/17pZiTkG1ghwhSEJE3gs0pKf3qyZmdQRkROoJACLRykQU69aIFKE3P Mb0ChmnhVIfXzRafGB43WvopzBVQYzAkXjhfxkQTGKYmYDUT37iH0kskJT0vEX+T LL7ZhNcIMxiGeLnjfb9SonuCIcbGPTN4g4WxEyPkLgxl/5M0mdVq9vqp33ZDxczT PD/xyIN5Kdo1yWNrUelticEj+g3mWCe47FlpryUHDb2Zzq58hl5YypjgvWV7+/NB g9Vda6qC7hDBkcRPyJapBEJQbRSsXj+m5OaevwTsi8cSKMa+hxw5z/KiX1J43wwg Q/RafO3EpzEipCmLDKDdJeEZNT18gLoRZW1KXRvpzUpEowjdO8E= =2GxO -----END PGP SIGNATURE----- --Apple-Mail=_72246CCC-3E94-4AD3-B07D-7282944672CB--