From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id HCxGNxaGFmHSWAAAgWs5BA (envelope-from ) for ; Fri, 13 Aug 2021 16:47:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4BzLMhaGFmGXBAAA1q6Kng (envelope-from ) for ; Fri, 13 Aug 2021 14:47:50 +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 EA171DAFF for ; Fri, 13 Aug 2021 16:47:49 +0200 (CEST) Received: from localhost ([::1]:45426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEYTN-0002jv-1U for larch@yhetil.org; Fri, 13 Aug 2021 10:47:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEYSq-0002ji-Hh for emacs-orgmode@gnu.org; Fri, 13 Aug 2021 10:47:16 -0400 Received: from mout01.posteo.de ([185.67.36.65]:37755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEYSl-0008Jb-80 for emacs-orgmode@gnu.org; Fri, 13 Aug 2021 10:47:16 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 36896240029 for ; Fri, 13 Aug 2021 16:47:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1628866028; bh=dVUTOJKqXr6AVFmxCgL4Wx0RwYJdGzQP1RDKDZ3NwMk=; h=From:To:Cc:Subject:Date:From; b=Otg0fiD1EiylFwEZiCYTk3vZC5WtxV/1BfSuL0DXrOrwB4JZsDAQh+7ArXsqkWqr6 adQXTaP9s3sY3QNCYIiZzyD1eYMpyBk+2XHAiHIGmcT1ylC/3npFNjPYxfSX0SRukR XIYJM6IcUJgvmN+CRdTODPmizHGQknXCszYlMpwguJdvpPRTGnfeZGRNkK4wEox2Bc iLFq6XVSbzMJpaCIdSZL8nNODmIQ1oJV8lvGA1wAxnBiGVg0gxKxvzbVbVq7Ms3DDN rlE8bpOhhPvZqbGEB9uI956jD0JCCEGo6C1jm2nLYWc6vBvIRxKe3TgoQq5lQAuQMI u4qvEwqetP6Bw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GmRGg35x7z6tm4; Fri, 13 Aug 2021 16:47:07 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Roger Mason Subject: Re: return column from table as a column References: Date: Fri, 13 Aug 2021 14:47:05 +0000 In-Reply-To: (Roger Mason's message of "Fri, 13 Aug 2021 11:47:53 -0230") Message-ID: <87czqhieqe.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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: , Cc: orgmode 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=1628866070; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=67PTBm6I61eMf57gzVwO3HpMYFEXDziKV2eD48v1maM=; b=OFXz+NqTXtExf7xvCRxNYlYlBvT5Ja5df/aFTTIMVdQ9zC6hEhqwBmRk+6V2sYEzaBesOG fo9yg8yXxcibBT06PyQA53HF1X/Q9mIOI0QSyA+dw1Ixjw8CRjrEqJuMA7QEYa4Ozy6zE0 etvqhaAItUO2LzOVexxFE0k3P3I47ZtiFDDCylQSbRMEtlc83e/m55t4bhoI0Tp8v2AcQD hXmdAt0y/2HIvoLFz43eQqA9rCnxgvkbm+DsjJMuweUTpY0cikPo8SGPkQtClqR1CDHpkX kCNk34t/+pF0wHXqYhCfZLZ+gs+NIIE/ZYMrQ+R95loll0/f+1PziCxkhu0DBg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628866070; a=rsa-sha256; cv=none; b=guqERaiBQ3LtB1AR82gD3m3OkTTAldnlwbM03yw5cNLkj38y8Ytdix3V+OpAduG69c8l+2 kb1A6iJjBRVN+AtlRNcWC4gEDik3zineVtH0btWGeEBE07D9VaIFRaQjDlOpCntL/DcT28 E1uwD9x4ksAjOUSO1s+RwMGSSL2i9b03wSB9lSne6xFndVRCRlgwMY1HQi9ywL9YtvAOna sNUmnCuR4/8LvQ8vm6lCORQqnUBhIQWlGuRnkcsmI/8f++jf8YuBS3NnEqVK6d1M9K3/Ms ydKITx6c2tUcVMtWp8iZ5rcgADgVNXFpI3AD1KCfSE6t/qcl/u7ACLXlFzVX8Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Otg0fiD1; dmarc=pass (policy=none) header.from=posteo.net; 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: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Otg0fiD1; dmarc=pass (policy=none) header.from=posteo.net; 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: EA171DAFF X-Spam-Score: -3.11 X-Migadu-Scanner: scn1.migadu.com X-TUID: pbks7cDopA+w Hi Roger, It's a dirty solution, but you can try: #+name: s1 | scale | scale1 | scale3 | jid | | - | 1.00402 | 0.952329 | 1632 | | - | 1.00402 | 0.962247 | 1633 | #+begin_src emacs-lisp :var data=s1 col=3 (let* ((column (mapcar (lambda (r) (format "%s" (nth col r))) data))) (mapcar 'list column)) #+end_src #+RESULTS: | jid | | 1632 | | 1633 | Best regards, Juan Manuel Roger Mason writes: > Hello, > > I need to extract a column from a table to use as input to a source > block. I want the extracted column to be returned as a column but it is > returned as a row. The following illustrates the problem: > > #+name: s1 > | scale | scale1 | scale3 | jid | > > | - | 1.00402 | 0.952329 | 1632 | > | - | 1.00402 | 0.962247 | 1633 | > > #+begin_src emacs-lisp :var data=s1[,3] > data > #+end_src > > #+RESULTS: > | jid | 1632 | 1633 | > > I want: > > | jid | > | 1632 | > | 1633 | > > Is there some means of changing 'data=s1[,3]' to accomplish this? > > Thanks, > Roger > > GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo > version 1.16.0, Xaw3d scroll bars) > > Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @ > /home/rmason/.emacs.d/org-git/lisp/) >