From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GMnDAIX9YWFdNQAAgWs5BA (envelope-from ) for ; Sat, 09 Oct 2021 22:37:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YAIqN4T9YWGkFAAAB5/wlQ (envelope-from ) for ; Sat, 09 Oct 2021 20:37:24 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 467C21AC9E for ; Sat, 9 Oct 2021 22:37:24 +0200 (CEST) Received: from localhost ([::1]:58902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZJ5u-0007Wr-5a for larch@yhetil.org; Sat, 09 Oct 2021 16:37:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZJ50-0007Wi-1y for emacs-orgmode@gnu.org; Sat, 09 Oct 2021 16:36:26 -0400 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]:21036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZJ4x-0003dc-BF for emacs-orgmode@gnu.org; Sat, 09 Oct 2021 16:36:25 -0400 Received: from [192.168.1.37] (unknown [88.162.223.185]) (Authenticated sender: emm.charpentier@free.fr) by smtp5-g21.free.fr (Postfix) with ESMTPA id F14335FF23 for ; Sat, 9 Oct 2021 22:36:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1633811779; bh=9rgH3CqEUCz0UmFSbVkq+YaiNogPOKSBpx6iU9/pA9Y=; h=Subject:From:To:Date:From; b=IE0Wg78SrtY1Y10FJrEGdLt/p41xssDABWl9vSDcI1xNrgrt5VJq1qIKwzaawy4YI lb4Y+2w6Y6bfB9ejdrrOhlouc0QteDbkncbJFnvE+zJ5GYrF+cW6iXIdpilrs2e+9j 5z9wv64Oh2057jWO89bRNGJBxm3GYLTxe9kFpJxDkvy97KDEmaD6n+COcIL05Mgwa1 ZpwzMV298a9fehr5XM90KKaJh6D8ivgHKAnGNga7pbRd3yAECcHWn52FdWYX3oTQML I80pUjkIzIncWqI0+xcJyRAW0D3WrL6rY/0qC/+EB16zvTqOuih6Zm4jaUV0AihwGS nFmvQTPxcOqAw== Message-ID: <6098f0e50f27c9e15ef6678362bd58a86f1d9c05.camel@free.fr> Subject: How to retrieve ALL the information of an Org table ? From: Emmanuel Charpentier To: emacs-orgmode@gnu.org Date: Sat, 09 Oct 2021 22:36:17 +0200 Organization: =?ISO-8859-1?Q?Organis=E9?= ? Moi ??? Content-Type: multipart/mixed; boundary="=-u50RilH3n+IpC81N2AsR" User-Agent: Evolution 3.42.0-2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a01:e0c:1:1599::14; envelope-from=emm.charpentier@free.fr; helo=smtp5-g21.free.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633811844; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KgVazYMHp2pxmTuKFTs/3i+uFU614hIEKzcyF0f4PjM=; b=q0j0kSUVHo8DyW+8Xu9/OXyPZneMmboGR/B1LDWcw/tEeLOmNXvpC7ereUWPPDSHMSD82r uptlYdUyL8awXlNnq916FzLUQ/0LHXtOlYucmzy1KuBhoKgt/LDZMbl/VTUC+yBHdWKY1a xoN7XI6EBl4NO/d8Ysw5hHIPCvpZ1bJDYMju3W2C8DxoAUa+NUcKVuco1cVqROaX9IkNmw WDhdaBVHybN8X7L5WQJMKMIZdsCqS+6sMG5OJUMDkslLyRHdZCZ0W1FPYa7arVhwFZenRi YUhPmXolN00jOGW2zp70zWzOxx2N+kkfovhKzD7lvwJuvwNgcfBcLevIDREfEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633811844; a=rsa-sha256; cv=none; b=ROK6vXZfNA1rS0n8x5uyqkpJzboQ6TgPNczxF1vr2LCpkQIywnL5PjifV6NQheYITtybXV 0oMFwxssBEDQV9Hcerqqu6FrAjr8NRjUbWCVM30KfQ9L5njYiPxpbXridwXbf76v7BPVmP 9Tnq2f23zo95VyNEYs/X6nBRM674mW4OLXoYd8VsadeIu86BVHEeyNXIxPm4n2RgSvU9Gx Mm061FCMpI+dwsAKnocITnZxeQeVdDCguJ34c8lH0NHntMz00SFAYuwJQkAJ6tkkuCrnx2 3KNi6nfxwLTJmTJ8v+LJjEYrO47XCyTaFw5MV1iIdR6jj2+6cXNmo/LTz84Dcw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=IE0Wg78S; dmarc=pass (policy=none) header.from=free.fr; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 1.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=IE0Wg78S; dmarc=pass (policy=none) header.from=free.fr; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 467C21AC9E X-Spam-Score: 1.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: xt+g7jK+8h18 --=-u50RilH3n+IpC81N2AsR Content-Type: multipart/alternative; boundary="=-nBUkFqJC7L9M9JAfpJww" --=-nBUkFqJC7L9M9JAfpJww Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Dear list, I have problems with exploiting programatically the structure of an Org table : I want to write function acting on complex tables, where the original information is presented along various statistics. My idea is to isolate the original information in a range delimited (by convention) by the first and second hlines and by the first and last columns ; the function should accept the whole table and retrieve the original data. The point is that the function should accept a variable number of lines in both the "original data" range and the summary information. Let ttest such a table with hlines : #+name: ttest | ttest | c1 | c2 | rSum | |-------+----+----+------| | 3 | 3 | 5 | 8 | | 8 | 8 | 12 | 20 | |-------+----+----+------| | cSum | 11 | 17 | 28 | #+TBLFM: @>$2..@>$>=vsum(@I..@II)::@2..@>>$4=vsum($<<..$>>) ttestc1c2rSum3358881220cSum111728 Passing this table as an argument to source code loses the hlines : #+begin_src emacs-lisp :exports results :results drawer :var foo=ttest foo #+end_src ((ttest c1 c2 rSum) (3 3 5 8) (8 8 12 20) (cSum 11 17 28)) The structure allowing to retrieve the original data is lost. The point is that the source code can't exploit the hlines to find relevant information (in the present case, the lines between the hlines). Alternatively, one may try and pass the relevant range, using foo=(org- table-get-remote-range "ttest" "@I$<<..@II$>>") as an argument. This fails for a different reason : #+begin_src emacs-lisp :exports results :results drawer :var foo=(org- table-get-remote-range "ttest" "@I$<<..@II$>>") foo #+end_src (3 5 8 12) Again, the structure is lost : this time, foo is a "flattened" vector, whose matricial shape is lost to the processing function. I am looking for explanations and/or hints. Attached : the source of the present mail. Thanks in advance... -- Emmanuel Charpentier --=-nBUkFqJC7L9M9JAfpJww Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Dear list,
I have proble= ms with exploiting programatically the structure of an Org table :
I want to write function actin= g on complex tables, where the original information is presented along vari= ous statistics. My idea is to isolate the original information in a range d= elimited (by convention) by the first and second hlines and by the first an= d last columns ; the function should accept the whole table and retrieve th= e original data. The point is that the function should= accept a variable number of lines in both the "original data" range and th= e summary information.
Let ttest such a table with hlines :
<= span style=3D"color: rgb(178, 34, 34);">#+name: ttest | ttest | c1 | c2 | rSum | |-------+----+----+------| | 3 | 3 | 5 | 8 | | 8 | 8 | 12 | 20 | |-------+----+----+------| | cSum | 11 | 17 | 28 | #+TBLFM: @>$2..@>$>=3Dvsu= m(@I..@II)::@2..@>>$4=3Dvsum($<<.= .$>>)
<= /colgroup>520
tt= estc1c2rSum
338
8812
cSum1= 11728
Passing this table as an argum= ent to source code loses the hlines :
#+begin_src emacs-l=
isp :exports results :results drawer :var foo=3Dttest
  foo
#+end_src
((ttest c1 c2 rSum) (3 3 5 8) (8 8 12 20) (cSum 11 17 28))=
The structure allowing to retrieve the original data is lost.
The point is that the source code can't exploit the hlines to find = relevant information (in the present case, the lines between the hlines).
Alternatively, one may try and pass the relevant range, using foo=3D(org-table-get-remote-range "ttest" "@I$<<<= a href=3D"mailto:..@II">..@II$>>") as an= argument. This fails for a different reason :
#+begin_sr=
c emacs-lisp :exports results :results drawer :var foo=3D(org-table-get-rem=
ote-range "ttest" "@I$<<..@II$>>")=

  foo
#+end_src
(3 5 8 12)
Again, the structure is lost : this t= ime, foo is a "flattened" = vector, whose matricial shape is lost to the processing function.
I am looking for explanations and/or hints.

Attac= hed : the source of the present mail.

Thanks in ad= vance...

--
Emmanuel Charpentier

--=-nBUkFqJC7L9M9JAfpJww-- --=-u50RilH3n+IpC81N2AsR Content-Disposition: attachment; filename="TstTableRange.org" Content-Type: text/plain; name="TstTableRange.org"; charset="UTF-8" Content-Transfer-Encoding: base64 IytvcHRpb25zOiBhdXRob3I6bmlsIHRvYzpuaWwKIytwcm9wZXJ0eTogaGVhZGVyLWFyZ3M6cHl0 aG9uIDpzZXNzaW9uCiMgIytsYXRleF9oZWFkZXI6IFx1c2VwYWNrYWdle21pbnRlZH0KCiMrYmVn aW5fc3JjIGVtYWNzLWxpc3AgOmV4cG9ydHMgbm9uZQogIChzZXRxIG9yZy1vZHQtcHJlZmVycmVk LW91dHB1dC1mb3JtYXQgImRvY3giCglvcmctbGF0ZXgtdG8tbWF0aG1sLWNvbnZlcnQtY29tbWFu ZAoJImxhdGV4bWxtYXRoIFwiJWlcIiAtLXByZXNlbnRhdGlvbm1hdGhtbD0lbyIKCTs7IG9yZy1s YXRleC1saXN0aW5ncyAnbWludGVkCglvcmctbGF0ZXgtbGlzdGluZ3MgbmlsCglvcmctbGF0ZXgt cGRmLXByb2Nlc3MKICAgICAobGlzdCAibGF0ZXhtayAtcGRmIC1wZGZsYXRleD0nJWxhdGV4IC1p bnRlcmFjdGlvbj1ub25zdG9wbW9kZSAtc2hlbGwtZXNjYXBlJyAtYmlidGV4IC1mICVmIikpCiMr ZW5kX3NyYwoKIytSRVNVTFRTOgp8IGxhdGV4bWsgLXBkZiAtcGRmbGF0ZXg9JyVsYXRleCAtaW50 ZXJhY3Rpb249bm9uc3RvcG1vZGUgLXNoZWxsLWVzY2FwZScgLWJpYnRleCAtZiAlZiB8CgpEZWFy IGxpc3QsCgpJIGhhdmUgcHJvYmxlbXMgd2l0aCBleHBsb2l0aW5nIC9wcm9ncmFtYXRpY2FsbHkv IHRoZSBzdHJ1Y3R1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