emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inserting a row divider/header into org-babel results


From: sergio ruiz
Subject: Inserting a row divider/header into org-babel results
Date: Tue, 14 Jan 2020 16:01:45 -0500

Adding a header to the data
===========================

  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 = (1..5)
  |   columns = (1..5)
  |   results = []
  |   rows.each_with_index do |row|
  |     result_row = []
  |     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=get&search=0x69B08F58923AB3A2
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
https://sergio101.com
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

Attachment: signature.asc
Description: Message signed with OpenPGP


reply via email to

[Prev in Thread] Current Thread [Next in Thread]