emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.brand@alumni.ethz.ch>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Org-Mode List <emacs-orgmode@gnu.org>
Subject: Re: Re: Can't import a remote reference to a whole column in orgtbl
Date: Sun, 04 Apr 2010 21:02:40 +0200	[thread overview]
Message-ID: <4BB8E250.8090404@alumni.ethz.ch> (raw)
In-Reply-To: <789851DE-3D35-4623-AB0A-E4168A5A178E@gmail.com>

Carsten Dominik wrote:
>> but being able to import whole rows/columns
>> would be incredibly useful.
> 
> There is actually now a way to do tis - even though it is inefficient.  
> To copy column 2 from table FOO into column 3 of the current table, use
> 
>  #+TBLFM: $3=remote(FOO,@@#$2)
> 
> This is now possible due to a patch by Michael Brand:
>     http://thread.gmane.org/gmane.emacs.orgmode/22930
> 
> It works well, but it is inefficient because this formula will
> parse the FOO table again for each field to be copied.

Very nice use case for `@#'. How about a doc update somehow like this?

=============================================================================
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -2061,10 +2061,15 @@ see the @samp{E} mode switch below).  If
  For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be used to
  get the row or column number of the field where the formula result goes.
  The traditional Lisp formula equivalents are @code{org-table-current-dline}
-and @code{org-table-current-column}.  Example:
+and @code{org-table-current-column}.  Examples:

  @example
-if(@@# % 2, $#, string(""))      @r{column number on odd lines only}
+if(@@# % 2, $#, string(""))   @r{column number on odd lines only}
+$3 = remote(FOO, @@@@#$2)      @r{copy column 2 from table FOO into}
+                             @r{column 3 of the current table@footnote{Both
+tables must have the same count of rows.  Inefficient for a large count N of
+rows with a time complexity of O(N^2) because all rows of the FOO table will
+be parsed again for each field to be copied.}}
  @end example

  @subsubheading Named references
=============================================================================

  reply	other threads:[~2010-04-04 19:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26  0:43 Can't import a remote reference to a whole column in orgtbl Ismael Barros²
2010-02-26  0:54 ` Ismael Barros²
2010-02-26  9:27   ` Giovanni Ridolfi
2010-04-03 17:24     ` Ismael Barros²
2010-04-04  6:47       ` Carsten Dominik
2010-04-04 19:02         ` Michael Brand [this message]
2010-04-04 20:08           ` Carsten Dominik
2010-04-05  6:11             ` Michael Brand
2010-04-05  6:48               ` Carsten Dominik
2010-04-05 18:26                 ` Michael Brand
2010-04-06  5:15                   ` Carsten Dominik
2010-04-07 19:55                     ` Michael Brand
2011-11-01 21:14                       ` [Orgmode] " Nick Dokos
2011-11-01 21:23                       ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BB8E250.8090404@alumni.ethz.ch \
    --to=michael.brand@alumni.ethz.ch \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).