From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id u84wHeH4X19tHgAA0tVLHw (envelope-from ) for ; Mon, 14 Sep 2020 23:12:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AJgtF+H4X1+tWQAAB5/wlQ (envelope-from ) for ; Mon, 14 Sep 2020 23:12:33 +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 53AE79401D0 for ; Mon, 14 Sep 2020 23:12:32 +0000 (UTC) Received: from localhost ([::1]:57466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHxe9-0003sy-EY for larch@yhetil.org; Mon, 14 Sep 2020 19:12:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHxdf-0003lB-3X for emacs-orgmode@gnu.org; Mon, 14 Sep 2020 19:11:59 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:36368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHxdc-0007kK-Qk for emacs-orgmode@gnu.org; Mon, 14 Sep 2020 19:11:58 -0400 Received: by mail-wr1-x436.google.com with SMTP id z1so1333800wrt.3 for ; Mon, 14 Sep 2020 16:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dCCW0R+r9Gt0p2SdlrA0YWvRVU9o3xqmapPqBHXM2cY=; b=LyQ9NvgyY7WVRbdLHypoqkOZbnRmq6o9XpewOKooToBJaaFietj1+bcq7MEiGwnuVc betiIcHGcu7LjCZaiB1h7iBy+WC8NYjej2efgZjENSBfxWnazmKk/doddfmB22CQNe+g zENAQxwidooNJ8BQa0iMQ4xSLngPv6gXG8YR6FFgj5MBk7SyLlkwu4/VrZfKQ8YnJW7B FpBSko9c7UR4T4i66iHzIPDgVCZx9OX5At4UGmVqM4UGUu5etbSDFu3Rc5JFeZqYatMj zfm3XAFjwpgZ5DBt5ACawky5N3NpwhWi/7eaQPMdRAQoWwkfKvdc7+UGBsON9ZFBMgt+ rdyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dCCW0R+r9Gt0p2SdlrA0YWvRVU9o3xqmapPqBHXM2cY=; b=f+1HMf5g+sWmfPn98/EHGU0z7LN5trt/JLRPgv4Li2/ejub1jDHImyIryJ3xNqeeS8 HDfdTWbV/F8l0pLEmQgFjR00Oahv4UjN5NYLjPXYnnMZ27Il+LAdsvx+O+3e9kFC560V nEiyhUNuB2V/16QkDDKDmxd7slk6AMtErLqnheUGJ/C36+CabhdXX3muOFGpuDdmBkTD xlmSvUY1wVF8yCsgW9fczzJI0XRTgVWXEzxL0cBPQXvP2wx83I585DcXM8gRLpGxiiB+ eKlTJH5VjsgqwEcYtOZlYpyQyLbonCG9T96AYxRWNYHVpr8vWuKTd9U2AER1fr7cCO4e xosQ== X-Gm-Message-State: AOAM5321BVI35mbatTwErbiiy0+Hr8gu38hNhZ/Bz8eCLq+AQzodttLQ l5kn3WvkLFLeGDoGK1ANpxHLPdlOSbOOC89ACJg= X-Google-Smtp-Source: ABdhPJzrXUkY4npRQHEOD8CbXSC3RG1NqrFaQZXcGa42TNe9xi/A6BrHlrs7KLuZN2HJ2ooSO7fGvui1uTIId5akdwk= X-Received: by 2002:a05:6000:10c1:: with SMTP id b1mr14148566wrx.212.1600125113345; Mon, 14 Sep 2020 16:11:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: John Kitchin Date: Mon, 14 Sep 2020 19:11:42 -0400 Message-ID: Subject: Re: How to refer to remote table, in another file, as a source block variable? To: William Denton Content-Type: multipart/alternative; boundary="000000000000fa2b6c05af4e28e2" Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=johnrkitchin@gmail.com; helo=mail-wr1-x436.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=LyQ9Nvgy; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); 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-Spam-Score: -0.11 X-TUID: nh/wGiOx7qgO --000000000000fa2b6c05af4e28e2 Content-Type: text/plain; charset="UTF-8" I think you are looking for (Assuming your table is in an org file called test.org): #+BEGIN_SRC ipython :var data=test.org:test_table for row in data: print(row) #+END_SRC #+RESULTS: :results: # Out [2]: # output ['two', 'yes'] ['three', 'yes'] ['four', 'no'] :end: John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Mon, Sep 14, 2020 at 5:58 PM William Denton wrote: > My apologies for sending this around a second time, but I still haven't > got it > so I thought I'd try again. If it's possible to refer to a remote table > in > another file, I've love to know how. > > > Bill > > > On 7 August 2020, William Denton wrote: > > > I can't figure this one out. Let's say I have a table in an Org file, > like > > so: > > > > # ----- > > > > * Primes > > > > #+NAME: test_table > > | number | prime | > > |--------+-------| > > | two | yes | > > | three | yes | > > | four | no | > > > > # ----- > > > > In another file, I want to bring this table into a source block as a > > variable. If it was the same file, I'd say ":var t=test_table" and > that's > > that. But what's the syntax for a different file? I can't figure it > out > > from the docs [1] and none of my attempts with quotes, file:, etc. work. > > It's something like this, isn't it? But what? > > > > #+begin_src R :var t=(remote(table.org::*Primes)) > > t > > #+end_src > > > > Thanks, > > > > Bill > > > > [1] https://orgmode.org/manual/References.html#References > > -- > > William Denton :: Toronto, Canada --- Listening to Art: > > https://listeningtoart.org/ > > https://www.miskatonic.org/ --- GHG.EARTH: https://ghg.earth/ > > Caveat lector. --- STAPLR: https://staplr.org/ > > > > -- > William Denton :: Toronto, Canada --- Listening to Art: > https://listeningtoart.org/ > https://www.miskatonic.org/ --- GHG.EARTH: https://ghg.earth/ > Caveat lector. --- STAPLR: https://staplr.org/ > > --000000000000fa2b6c05af4e28e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think you are looking for (Assuming your table is in an = org file called test.org):

#+BEGIN_SRC ipython :var data=3Dtest.org:test_table
for row in data:<= br>=C2=A0 =C2=A0 print(row)
#+END_SRC

#+RESULTS:
:results:
= # Out [2]:
# output
['two', 'yes']
['three= 9;, 'yes']
['four', 'no']

:end:
<= div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature= ">
John

----------------------= -------------
Professor John Kitchin=C2=A0
Doherty Hall A207F
Depa= rtment of Chemical Engineering
Carnegie Mellon University
Pittsburgh,= PA 15213
412-268-7803


On Mon, Sep = 14, 2020 at 5:58 PM William Denton <wtd= @pobox.com> wrote:
My apologies for sending this around a second time, but I still = haven't got it
so I thought I'd try again.=C2=A0 If it's possible to refer to a re= mote table in
another file, I've love to know how.


Bill


On 7 August 2020, William Denton wrote:

> I can't figure this one out.=C2=A0 Let's say I have a table in= an Org file, like
> so:
>
> # -----
>
> * Primes
>
> #+NAME: test_table
> | number | prime |
> |--------+-------|
> | two=C2=A0 =C2=A0 | yes=C2=A0 =C2=A0|
> | three=C2=A0 | yes=C2=A0 =C2=A0|
> | four=C2=A0 =C2=A0| no=C2=A0 =C2=A0 |
>
> # -----
>
> In another file, I want to bring this table into a source block as a <= br> > variable. If it was the same file, I'd say ":var t=3Dtest_tab= le" and that's
> that.=C2=A0 But what's the syntax for a different file?=C2=A0 I ca= n't figure it out
> from the docs [1] and none of my attempts with quotes, file:, etc. wor= k.
> It's something like this, isn't it?=C2=A0 But what?
>
> #+begin_src R :var t=3D(remote(table.org::*Primes))
> t
> #+end_src
>
> Thanks,
>
> Bill
>
> [1] https://orgmode.org/manual/References.= html#References
> --
> William Denton :: Toronto, Canada=C2=A0 =C2=A0---=C2=A0 =C2=A0Listenin= g to Art:
> https://listeningtoart.org/
> https://www.miskatonic.org/=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0---= =C2=A0 =C2=A0GHG.EARTH: https://ghg.earth/
> Caveat lector.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 ---=C2=A0 =C2=A0STAPLR: https://staplr.org/
>

--
William Denton :: Toronto, Canada=C2=A0 =C2=A0---=C2=A0 =C2=A0Listening to = Art: https://listeningtoart.org/
https://www.miskatonic.org/=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0---=C2= =A0 =C2=A0GHG.EARTH: https://ghg.earth/
Caveat lector.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ---=C2=A0 =C2=A0STAPLR: https://staplr.org/

--000000000000fa2b6c05af4e28e2--